草庐IT

default-method

全部标签

iphone - 忽略 "UIViewController may not respond to [method]"警告的方法

有没有办法让编译器忽略这个特定的警告?这是我的做法:UIViewController*firstViewController=AppDelegate.instance.viewController;//opentheviewoftheclickedsubItemif([firstViewControllerrespondsToSelector:@selector(openView:inView:)]){[firstViewControlleropenView:subItem.itemText.textinView:activeScreen];//warningonthisline}我知

javascript - React native Undefined 不是对象(evaluating'_react3.default.PropType.shape')

由于这种情况,我正在研究React-native我想为IOS和Android创建导航,实际上,我遇到了一个错误错误:ReactnativeUndefinedisnotanobject(evaluating'_react3.default.PropType.shape')我的开发环境操作系统:MACOSSierra客户端:react-native-cli:2.0.1React-native版本:react-native:0.49.3我关注官方react-nativetutorialApp.jsimportReact,{Component}from'react';import{Platfo

ios - 位置管理器 :didRangeBeacons method not detecting BLE Device

我正在使用NordicBLEnRF8001开发套件来测试CoreBluetooth。使用CBCentralManager的方法(例如didDiscoverPeripheral()、didConnectPeripheral()等)我的iPhone5能够检测到Nordic设备的广告并正常连接。但是,我没有收到来自新的locationManagerranging或regionMonitoring方法的任何响应。下面我将解释我的设置:1.)首先,我使用传入的外围设备(我的Nordic设备)在didDiscoverPeripheral()委托(delegate)方法中从我的Nordic设备检索了

iOS 核心位置 : How to disable the default iOS pop-up message for user permission

我正在使用核心位置框架在我的iOS应用程序中收集设备位置。当我第一次在设备上安装该应用程序时,iOS会通过如下所示的警告View请求用户许可。有什么方法可以禁用此默认警报View并向用户显示自定义消息吗? 最佳答案 我在添加目的消息的位置添加了屏幕截图。 关于iOS核心位置:HowtodisablethedefaultiOSpop-upmessageforuserpermission,我们在StackOverflow上找到一个类似的问题: https://st

ios - authorize.net ios sdk 中的 "The authentication type is not allowed for this method call"错误

我正在尝试在我的应用程序中使用授权iossdk作为支付网关。我已成功集成,但测试帐户出现上述错误。AuthNet*an=[AuthNetgetInstance];[ansetDelegate:self];CreditCardType*creditCardType=[CreditCardTypecreditCardType];creditCardType.cardNumber=@"38000000000006";creditCardType.cardCode=@"100";creditCardType.expirationDate=@"121213";PaymentType*paymen

objective-c - 如何在 ios 中不收到 "instance method not found"警告的情况下调用委托(delegate)函数?

在我开发的应用中,经常会发现这样的代码行[delegateaFunction];生成“未找到实例方法“aFunction”(返回类型默认为id)”警告现在,我对SO做了一些研究,发现可以通过声明函数来删除警告,当你在self([selfaFunction];)上调用它时,但是没有任何答案说明我的情况是,当我使用委托(delegate)时。所以,长话短说,我该怎么做才能在另一个类中正确调用委托(delegate)的方法?事情似乎工作正常,所以这不是主要问题,但警告意味着我没有做完全正确的事情所以我想了解这种情况下的最佳做法是什么提前感谢您的帮助! 最佳答案

ios - 尝试对 UITableView 中的单元格重新排序时获取 '-[__NSCFArray removeObjectAtIndex:]: mutating method sent to immutable object'

我正在使用AFNetworking获取UITableView单元格中的JSON数据。我已将数组声明为NSMutableArray,但我仍然收到-[__NSCFArrayremoveObjectAtIndex:]:mutatingmethodsenttoimmutableobject错误,每当我试图重新排序单元格。这是我用于重新排序的逻辑--(void)tableView:(UITableView*)tableViewmoveRowAtIndexPath:(NSIndexPath*)fromIndexPathtoIndexPath:(NSIndexPath*)toIndexPath{NS

iphone - 访问 UITableView 的 "default"方法

我尝试设置一个tableView。除了最后一节(包含一行)之外,我对所有部分的行使用标准单元格。因此,除了那个特殊的部分,我还想对所有这些部分使用标准布局。一个简短的例子如下,我的“特殊”单元格在第3部分(只有一行):-(CGFloat)tableView:(UITableView*)tableViewheightForHeaderInSection:(NSInteger)section{if(section==3)return5;return**????**;}在???我想返回从UITableView计算的宽度(就像我没有实现该方法一样)。[superself:tableViewhe

iphone - 如何像 [self Method_Name]; 一样使用 self 调用方法;当方法名称很长时 Like -(void)imagePickerController : (UIImagePickerController *)

我是iPhone开发新手。我想知道如何使用self调用方法,例如:[selfMethod_Name];当方法名很长的时候-(void)imagePickerController:(UIImagePickerController*)pickerdidFinishPickingImage:(UIImage*)imageeditingInfo:(NSDictionary*)editingInfo{...}W想使用self调用imagePickerController方法。我尝试用以下方式调用它:[selfimagePickerController];//CrashHere但是代码总是在这一行

ios - Objective-C : Infinite getter method loop after converting to ARC

我有以下方法:-(NSMutableArray*)someArray{//line1if(self.someArray==nil){//line2self.someArray=[[NSMutableArrayalloc]init];}returnself.someArray;}我在非ARC中有这个,它工作正常:如果第2行中的self.someArray是nil,那么继续实例化它。但是,我切换到ARC之后,到了第2行,又回到第1行,继续循环。任何帮助将不胜感激。谢谢。 最佳答案 正确的形式是@synthesizesomeArray=_