草庐IT

main-method

全部标签

ios - 大小与字体 : ConstrainedToSize: lineBreakMode: method is deprecated in iOS 7

sizeWithFont:ConstrainedToSize:lineBreakMode:方法在iOS7中已弃用,我有点不确定如何准确处理这个问题。在互联网上做了一些研究后,我发现有一种新的方法可以处理这个问题,即:[txtdrawWithRect:options:attributes:context:]这是我目前正在尝试运行的方法:+(CGSize)textSizeForText:(NSString*)txt{CGFloatwidth=[UIScreenmainScreen].applicationFrame.size.width*0.75f;CGFloatheight=MAX([J

ios - 苹果 iOS : [AVAssetWriterInput appendSampleBuffer:] Cannot call method when status is 0

我正在尝试将CMSampleBufferRefs附加到AVAssetWriterInput,但我一直遇到错误崩溃:[AVAssetWriterInputappendSampleBuffer:]Cannotcallmethodwhenstatusis0代码:在viewDidLoad中NSArray*cachePaths=NSSearchPathForDirectoriesInDomains(NSCachesDirectory,NSUserDomainMask,YES);NSString*cacheDirectory=[cachePathsfirstObject];NSString*fil

iOS 8 : When App in Background CBCentralManager Delegate Method didDiscoverPeripheral, didConnectPeripheral、didFailToConnectPeripheral 未调用

我在iOS8中使用Xcode6。当应用程序在后台运行时,我正在尝试搜索和连接蓝牙设备。我正在使用核心蓝牙框架。我使用Xcode功能选项添加了蓝牙中心和蓝牙外围设备。代码:Appdelegate.h@interfaceWSAppDelegate:UIResponder@property(strong,nonatomic)NSString*savedUUID;@property(strong,nonatomic)CBCentralManager*CBCM;AppDelegate.m-(void)applicationDidEnterBackground:(UIApplication*)ap

ios - InputAccessoryView 的 viewWillDisappear : method called early in iOS 9

我在iOS9中遇到了一个非常不幸的错误。似乎当您设置UITextField.inputAccessoryView时,该View的viewWillDisappear:和viewDidDisappear:方法被过早调用(就在键盘完成动画时)。我已经包含了一个gif来演示这个问题。当View变为红色时,即调用了它的viewWillDisappear:方法。奇怪的是,当您关闭键盘时,viewWillDisappear:和viewDidDisappear:会再次被调用。但是,viewWillAppear:只被调用一次。有没有人遇到过类似的问题?我使用viewWillDisappear:和view

ios - 使用 UILocalizedIndexedCollat​​ion 和 localizedStandardCompare 对字符串进行排序 : method

使用这个(内存排序)时排序顺序有区别吗[[UILocalizedIndexedCollationcurrentCollation]sortedArrayFromArray:namesArraycollationStringSelector:@selector(sortName)]和这个(用于CoreData排序)fetchRequest.sortDescriptors=[NSArrayarrayWithObject:[NSSortDescriptorsortDescriptorWithKey:@"name"ascending:YESselector:@selector(localize

ios - ipatool 失败,出现异常 : #<NoMethodError: undefined method `toolsPath' for nil:NillClass>

将Xcode升级到9.0.1版本后,我在我的一个项目中导出为iPA时遇到错误“ipatool失败并出现异常:#NoMethodError:未定义的方法‘toolsPath’fornil:NilClass”。尝试导出其他项目文件和同一项目文件的旧版本,可能我能够导出iPA。由于依赖框架的限制,项目中的Bitcode被禁用。看了一些博客并没有找到这个问题的令人信服的答案。希望有人能帮助我理解这个问题吗?Xcodeversion:9.0.1MACOSVersion:10.13ipatoolJSON错误响应:{代码=646;description="ipatoolfailedwithanexc

javascript - React Native中 "folly/Portability.h"和 "File .../main.jsbundle does not exist"如何解决?

当我想为生产环境编译我的IOS应用程序时,出现以下错误:'folly/Portability.h'filenotfoundandecho'error:thisFile.../main.jsbundle不存在。这一定是的错误我已经在网上搜索了解决这个问题但是我无法解决这里是react-native的信息:ReactNativeEnvironmentInfo:System:OS:macOS10.14.4CPU:(4)x64Intel(R)Core(TM)i5-7360UCPU@2.30GHzMemory:38.35MB/8.00GBShell:3.2.57-/bin/bashBinarie

IOS 在 main() 之前执行什么?

objc[1655]:Object0x2314e0ofclass__NSCFStringautoreleasedwithnopoolinplace-justleaking-breakonobjc_autoreleaseNoPool()todebugobjc[1655]:Object0x2315e0ofclassNSPathStore2autoreleasedwithnopoolinplace-justleaking-breakonobjc_autoreleaseNoPool()todebugobjc[1655]:Object0x2316b0ofclass__NSCFDataautore

ios - Hello world 命令行 LLDB iOS 无法解析 'main' 中的断点

我已经提取了debugserver并将其复制到我越狱的iPhone5S上。然后我在我的mac上运行LLDB并使用说明连接它here.我使用SSH/SFTP复制了一个用C语言编写并为ARM64编译的简单的helloworld程序到我的iPhone5S上,并对其进行了chmod。我使用了命令:./debugserver*:1234helloworld64_full其中helloworld64_full是设备上的可执行文件。然后我开始连接到iPhone:platformselectremote-ios和processconnectconnect://localhost:1234停止在:Pro

ios - UIButton addTarget 的替代选项 :action:forControlEvents: method in IOS

我知道这个问题已被问过很多次,但我想在单击按钮时将自定义对象作为参数传递。UIButtonaddTarget:action:forControlEvents:不允许我们这样做,但这对我来说很重要,因此我可以在自定义对象的基础上做更多的事情。如果添加目标的替代方案是可能的,那么请给出解决方案。代码是这样的:自定义对象:HeaderData*cell;按钮:_forward=[UIButtonbuttonWithType:UIButtonTypeRoundedRect];[_forwardsetTitle:@"F"forState:UIControlStateNormal];_forwar