草庐IT

while-equivalent

全部标签

iphone - Objective-C : getting error on console while trying to display app on ipad device?

我试图在我的iPad上显示我的iphone/Ipad应用程序但出现此错误,我之前在设备上检查过此应用程序但现在它在控制台上显示错误。**warning:Unabletoreadsymbolsfor/Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.2.1(8C148)/Symbols/usr/lib/info/dns.so(filenotfound).****无法向引导服务器注册com.domainname.abcdef。错误:未知错误代码。这通常意味着此进程的另一个实例已经在运行或卡在调试器中。程序收到信号:“SIGABRT”

ios - 线程程序收到信号: "EXC_BAD_ACCESS" while finding the sum of a column in sqlite in ios

我编写了一个函数来从sqlite创建的表中查找总费用和今天的费用。这是我的代码-(void)calculateTodaysExp{constchar*dbpath=[databasePathUTF8String];sqlite3_stmt*statement1;if(sqlite3_open(dbpath,&expenseDB)==SQLITE_OK){NSString*todays=[NSStringstringWithFormat:@"SELECTsum(amount)FROMexpenseDetailsWHEREdate=\"%@\"",dateString];constchar

ios - 线程 1 : Fatal error: Unexpectedly found nil while unwrapping an Optional value while applying effects to image

我正在尝试对ImageView应用滑动、淡入淡出和增长效果。以下是我的代码@IBActionfuncfadeIn(_sender:Any){imageView.alpha=0UIView.animate(withDuration:1,animations:{self.imageView.alpha=1})}@IBActionfuncslideIn(_sender:Any){imageView.center=CGPoint(x:imageView.center.x-500,y:imageView.center.y)UIView.animate(withDuration:2){self.i

iphone - 如何在这个简单的 while 循环中使用 NSTimer?

我有一个-(void)方法正在执行,有一次它进入一个while循环,在它要求它们的那一刻直接从加速度计获取值我浏览了有关NSTimer类的文档,但我无法理解在我的案例中我应该如何使用这个对象:例如-(void)play{.........if(accelerationOnYaxis>0&&accelerationOnYaxis0&&accelerationOnYaxis=300msec){printOut_AccelerationStayedBetweenThoseTwoValuesForAtLeast300msecs;break_Out_Of_This_Loop;}}stopTime

mysql - iOS 5 : How can I preserve newline while retrieving values from mysql via PHP in UITextView and UIWebView

我正在从mysql数据库(使用PHP)中检索值,并将其显示在UITextView中,部分显示在UIWebView中。我存储在数据库中的值在文本中,但是当我在UITextView中显示它时,我想以点显示的数据显示为一个段落。我怎样才能换行,因为我收到的数据已经在NSString中了 最佳答案 UITextView在\n上换行,UIWebView显示html,如果您只有带有一些链接或其他内容的纯文本,您可以添加换一条新线。因此,为了保留UITextView的换行符,您需要\n和UIWebView有效的换行HTML(例如)。不确定你为什么

ios - -allKeys 后台线程导致错误 : __NSDictionaryM was mutated while being enumerated

我在后台线程上使用可变字典遇到了一个有趣的问题。目前,我正在一个线程上分块下载数据,将其添加到数据集中,并在另一个后台线程上处理它。除了一个问题外,整体设计大部分工作正常:有时,对主数据集中内部字典的函数调用会导致以下崩溃:***Collectionwasmutatedwhilebeingenumerated.我知道这是一个相当常见的崩溃,但奇怪的是它并没有在此集合的循环中崩溃。相反,Xcode中的异常断点停止在以下行:NSArray*tempKeys=[tempallKeys];这让我相信一个线程正在向这个集合添加项目而NSMutableDictionary对-allKeys的内部函

ios - Objective C : how to get the string equivalent, 或方法参数调用的变量名

我想制作一个记录View框架的简单方法,但也记录特定View输入的名称。除了输入字符串作为方法的参数之外,是否有一种简单的方法来获取与被调用View等效的字符串?-(void)printViewFrame:(UIView*)view{NSLog(@"%@'sframeis:originx:%f,originy:%f,sizex:%f,sizey:%f",view,view.frame.origin.x,view.frame.origin.y,view.frame.size.width,view.frame.size.height);}[selfprintViewFrame:myView

ios - 警告 : Attempt to dismiss from view controller <UINavigationController: 0xb359a20> while a presentation or dismiss is in progress

在我的应用程序中我正在做的是:rootViewController->pushViewController->pushViewController->pushViewController->presentModalViewController我想从presentModalViewController直接转到rootViewController。所以我所做的是:while(theViewController=[theObjectEnumeratornextObject]){if([theViewControllermodalTransitionStyle]==UIModalTransit

objective-c - 由于未捕获的异常 'NSGenericException' 而终止应用程序,原因 : '*** Collection <__NSArrayM: 0x138cb4d0> was mutated while being enumerated

我正在尝试从数组中删除重复的对象。NSMutableArray*filterResults=[[NSMutableArrayalloc]init];BOOLcopy;//removeduplicateif(![arrSelectedVehiclecount]==0){for(Vehicles*a1inarrSelectedVehicle){copy=YES;for(Vehicles*a2infilterResults){if([a1.Vehicle_idisEqualToString:a2.Vehicle_id]){copy=NO;[arrSelectedVehicleremoveOb

ios - "Collection ... mutated while being enumerated"崩溃

崩溃后出现此错误:malloc:***errorforobject0x75617b4:incorrectchecksumforfreedobject-objectwasprobablymodifiedafterbeingfreed.***setabreakpointinmalloc_error_breaktodebug2013-02-0519:15:44.950BusinessIdea[3171:15e03]***Terminatingappduetouncaughtexception'NSGenericException',reason:'***Collectionwasmutate