草庐IT

NoAutomaticTrigger-Method

全部标签

iphone - UILocalizedIndexedCollat​​ion 的 sectionForObject :(id)object collationStringSelector:(SEL)selector method 选择器的作用是什么

我是iOS开发的初学者,正在经历this文档(关于使用索引列表配置TableView的iOS开发人员指南)我遇到了这个://Listing4.7for(State*theStateinstatesTemp){NSIntegersect=[theCollationsectionForObject:theStatecollationStringSelector:@selector(name)];theState.sectionNumber=sect;}我无法弄清楚选择器(@selector(name))及其用途,也无法找到在选择器中传递名称的方法,即name.我在谷歌上搜索示例以找到更好的

ios - animationDidStop : finished: delegate method not getting called

我想在前一个动画例程完成后立即开始一个新的动画例程。然而,当前一个确实完成时,新的不会被触发,因为没有调用委托(delegate)方法。我已经委派了一个ViewController来处理按钮的CALayer的动画。“buttonSlide”是以前的动画,而“buttonFade”是新动画。这是代码片段:--(void)viewWillAppear:(BOOL)animated{NSLog(@"TimeViewappearing...");[superviewWillAppear:animated];[selfpressButton:nil];//Showscurrenttimeasso

iphone - Objective-C : swizzle object method after creation

我想在创建对象后调配对象方法。例子:@interfaceMyObj:NSObject-(NSString*)foo;-(NSString*)bar;@end@implementationMyObj-(NSString*)foo{return@"foo";}-(NSString*)bar{return@"bar";}@endvoidSwizzle(object,SELsource,SEL,dest);...MyObj*obj=[[[MyObjalloc]init]autorelease];NSLog(@"%@",[objfoo]);Swizzle(obj,@selector(foo),@

iphone - ios setHidden :NO at begin of a long method does not show on display

我有一个方法,它从Web服务加载数据。在该方法的开始,我想显示一个UIActivityIndi​​cator。但是只把hidden改成NO并不会重绘UIView。所以UIActivityIndi​​cator在长时间加载数据后可见,这肯定是迟到了。那么我如何告诉UIView在数据加载开始之前重绘activityIndi​​cator?-(IBAction)loadData{[activitysetHidden:NO];//heretheactivtyIndicatorshouldappear...loadlongdataFromNet..[activitysetHidden:YES];

ios - GMSThreadException' 原因 : 'The API method must be called from the main thread'

我在使用googleAPI绘制折线时遇到此错误由于未捕获的异常GMSThreadException而终止应用程序-(void)drawRoute{dispatch_queue_tmyQueue=dispatch_queue_create("MyQueue",NULL);dispatch_async(myQueue,^{[selffetchPolylineWithOrigin:origindestination:destinationcompletionHandler:^(GMSPolyline*polyline){dispatch_async(dispatch_get_main_que

iphone - 是什么导致此代码中的 "Missed Method"?

如果这是一个完全不合时宜的问题,或者我没有包含足够的信息,请提前致歉-我是iOS开发(和Objective-C)的新手,并且有跳跃的习惯进入深处...我在理解GKTapper示例代码中的GameCenterManager.m中的“callDelegate”代码时遇到了问题,该代码也在这个tuts+教程中提供:http://mobile.tutsplus.com/tutorials/iphone/ios-sdk-game-center-achievements-and-leaderboards-part-2/这是代码:-(void)callDelegate:(SEL)selectorwi

ios - performSegueWithIdentifier :method called from didSelectRowAtIIndexPath slow to show view

我有一个静态的UITableview并且正在尝试切换到模态视图。我不能直接从Storyboard中的单元格进行segue,因为有时我希望根据某些应用程序逻辑不调用segue。所以我将segue连接到TableViewController并在Storyboard中为其指定了一个标识符。然后在TableViewController中我调用了下面的方法。-(void)tableView:(UITableView*)tableViewdidSelectRowAtIndexPath:(NSIndexPath*)indexPath{//Performseguewhenfirstrowinfirst

iPhone : How to call other method from [_assetExport exportAsynchronouslyWithCompletionHandler: ^(void ) { }

我正在使用以下代码将.mp4和.caf组合成.mov。(注意:我知道如何播放视频所以不要为此提供代码)AVAssetExportSession*_assetExport=[[AVAssetExportSessionalloc]initWithAsset:mixCompositionpresetName:AVAssetExportPresetPassthrough];//AVAssetExportPresetPassthroughNSString*videoName=@"export.mov";NSString*exportPath=[documentstringByAppendingP

ios - 创建多个 NSURLConnections 并使用 sendAsynchronousRequest :queue:completionHandler: iOS 5 method

我在设置与sendAsynchronousRequest:queue:completionHandler:方法(NSURLConnection类)相关的正确配置时遇到了一些困难。我的场景如下:我设置了一个单例类来管理不同的NSURLConnection。此单例实例有一个NSOperationQueue(称为downloadQueue),它向Web服务器发出请求并检索字符串路径(1)。完成后,该路径用于在Web服务器(2)中下载文件。最后,当文件已正确下载后,我需要更新UI(3)。我只计算出第一个请求:我可以通过它下载路径的请求。你能建议我执行其他两个步骤的方法吗?这里有几个问题:下载队

ios - 在实现 mapView :didTapMarker: delegate method implemented 时在 google maps iOS sdk 中点击标记时显示信息窗口

好的,这是一个很长的标题。我在使用googlemapsiOSsdk时遇到了问题。我想显示一个关于用户点击的标记的信息窗口。根据文档,如果GMSMarker的snippet和title属性都被选中,则当用户点击该标记时,将显示信息窗口。但我还实现了mapView:didTapMarker:GMSMapViewDelegate协议(protocol)中的方法。如果我注释掉该方法信息窗口可见,否则信息窗口不可见。那么,当该方法实现时,我该如何显示信息窗口呢? 最佳答案 实现GMSMapViewDelegate的mapView:didTap