草庐IT

custom_obj

全部标签

ios - OBJ-C 操作指南 : App using BLE connection and iBeacon in same device

我有一个用例,我的objective-c应用程序在终止后需要立即使用iBeacon,以便将应用程序从终止状态唤醒,连接到BLE并向设备发送命令。我有一个运行时间更长的更大的postfoundhere,如果需要,您可以查看我的代码。问题到目前为止,问题发生在我运行应用程序、搜索以前配对的设备和/或扫描外围设备、找到我的BLE设备并连接时。连接后,用户将BLE连接配对,以便他们可以通过BLE连接发送加密的特征数据。如果没有配对(在设备的命名约定中也称为auth/bond),用户根本无法将数据发送到设备。它永远不会到达那里。一旦配对,您就可以发送命令...当我终止应用程序时,在applica

ios - OBJ-C : Core-Plot XY-Axis Fixing

我想固定坐标轴,使它们始终位于绘图空间的左侧和底部。我当前的实现未启用userInteraction,因此无需担心滚动。//SetupplotspaceCPXYPlotSpace*plotSpace=(CPXYPlotSpace*)graph.defaultPlotSpace;plotSpace.allowsUserInteraction=NO;//AxesCPXYAxisSet*axisSet=(CPXYAxisSet*)graph.axisSet;CPXYAxis*x=axisSet.xAxis;//x.majorIntervalLength=CPDecimalFromString

c# - 如何使用编码绑定(bind) Xamarin iOS Obj-C 库

我想研究如何将iOS库与指向Xamarin.iOS的处理指针绑定(bind)。它需要编码。我为测试准备了这样的库,MarshalTest.htypedefstruct{floatx,y,z;}Marshal3D;@interfaceMarshalTest:NSObject-(id)initWithMarshal:(Marshal3D*)marshal;-(id)initWithMarshals:(Marshal3D*)marshalsnum:(int)numCoord;-(void)addMarshal:(Marshal3D*)marshal;-(void)addMarshals:(M

ios - Obj-c - 返回原始状态时延迟动画?

当我的键盘被激活时,我正在使用下面的代码来移动View和我的表格View。但是,当键盘关闭时,upView在键盘关闭后需要2秒才能返回到原来的位置(另一方面,tableView是即时的)。为什么会这样?-(void)viewDidLoad{[superviewDidLoad];[[NSNotificationCenterdefaultCenter]addObserver:selfselector:@selector(keyboardWillChange:)name:UIKeyboardWillShowNotificationobject:nil];}-(void)keyboardWil

ios - UIButton 异常 : Unable to set title for a custom button type

我正在尝试为我以编程方式创建的自定义按钮设置标题。按钮的图像和框架出现正常,但标题没有。我真的想不出这段代码有什么问题,所以非常感谢您的帮助!self.helpButton=[UIButtonbuttonWithType:UIButtonTypeCustom];[self.helpButtonsetFrame:CGRectMake(113.0,685.5,73.0,40.0)];UIImage*helpImg=[UIImageimageNamed:@"11_HelpCancel_Up.png"];[self.helpButtonsetImage:helpImgforState:UICo

android - 如何使用标准属性android :text in my custom view?

我编写了一个扩展RelativeLayout的自定义View.我的View有文字,所以我想使用标准android:text无需指定并且不使用自定义命名空间xmlns:xxx每次我使用自定义View时。这是我使用自定义View的xml:如何获取属性值?我想我可以使用获取android:text属性TypedArraya=context.obtainStyledAttributes(attrs,???);但是???是什么?在这种情况下(在attr.xml中没有样式)? 最佳答案 使用这个:publicYourView(Contextco

android - 如何使用标准属性android :text in my custom view?

我编写了一个扩展RelativeLayout的自定义View.我的View有文字,所以我想使用标准android:text无需指定并且不使用自定义命名空间xmlns:xxx每次我使用自定义View时。这是我使用自定义View的xml:如何获取属性值?我想我可以使用获取android:text属性TypedArraya=context.obtainStyledAttributes(attrs,???);但是???是什么?在这种情况下(在attr.xml中没有样式)? 最佳答案 使用这个:publicYourView(Contextco

ios - UIAlertController 如何在 obj c 中添加标签值

将其用于UIAlertView-(void)alertStatus:(NSString*)msg:(NSString*)title:(int)tag{UIAlertView*alertView=[[UIAlertViewalloc]initWithTitle:titlemessage:msgdelegate:selfcancelButtonTitle:@"OK"otherButtonTitles:nil,nil];alertView.tag=tag;[alertViewshow];}但是现在UIAlertView被弃用了。更改我的代码UIAlertController*alertCon

ios - NSNumber 原始值相等与 isEqualToNumber 与 Obj-C 文字

既然我们在Objective-C中有了带有编译器支持的NSNumber字面量,是否有更好的方法将NSNumber与已知整数值进行比较?老办法是[myNumberintegerValue]==5现在我们可以执行[myNumberisEqualToNumber:@5]甚至[myNumberisEqualToNumber:@(someVariable)]。isEqualToNumber:方法是否有优势,或者我们应该坚持使用integerValue除非要比较的值已经是NSNumber?我看到的一个优势是,如果someVariable从NSInteger更改为CGFloat,则新方法不需要更改代

iOS : Customizing TableViewCell - Initializing Custom Cell

在我的TableView中,我有一个NSMutableArray*currList的数据源-它包含对象Agent的对象。我创建了自定义的TableCell并正确设置了所有内容。我在显示数据时发现问题:-(UITableViewCell*)tableView:(UITableView*)tableViewcellForRowAtIndexPath:(NSIndexPath*)indexPath{staticNSString*simpleTableIdentifier=@"ChatListCell";//CustomTableViewCellChartListCell*cell=(Char