ios4

ios 4.2 uiwebview javascript window.print doesn´t print, not launch before and after events

五迷三道 提交于 2019-12-31 04:56:09
问题 I´m using a uiwebview for doing an embedded web app, with the new iOS 4.2 you can print directly with objective-C, but I want to print from javascript in HTML. The problem is that I dont see the print dialog showing when clicking the button that executes window.print(). I have wrote also this code but it doesn't get events. function beforePrint () { alert("before rec"); } function afterPrint () { alert("after rec"); } function checks(){ alert("Activating checks"); window.onbeforeprint =

How to save a NSMutableDictionary into a file in documents?

别等时光非礼了梦想. 提交于 2019-12-31 04:00:51
问题 I would like to save the content of a NSMutableDictionary object to a file. How do I do this ? I already know how to do this task with a NSDictionary object but I don't know how to convert/copy this NSMutableDictionary to a NSDictionary...unless there's a method to write directly the content of NSMutableDictionary to a file...I stress that the NSMutableDictionary object contains objects of NSDictionary type. Thx for helping, Stephane 回答1: NSMutableDictionary is a subclass of NSDictionary :

Invalid Signature error !

霸气de小男生 提交于 2019-12-31 03:37:35
问题 I am trying to update my application , but after uploading the binary , Itunes connect sends me this email : Dear Developer, Thank you for your recent binary submission for "MY APP" to the App Store. Unfortunately we discovered an issue with your binary that you will need to correct in order for your application to proceed to the review stage. The specific issue is outlined below: Invalid Signature - Make sure you have signed your application with a distribution certificate, not an ad hoc

saving current date and time in my iPhone application?

不羁的心 提交于 2019-12-31 03:35:21
问题 In my application i am using In - App purchases to provide a subscription of 1 year….now i need to save the time and date when the user buys the subscription and need to check when the subscription expires?? i have not used database before is there any other way to store date and time in my application and retrieve it every time the application starts?? 回答1: You can simply store it in NSUserDefaults : [[NSUserDefaults standardUserDefaults] setObject:[NSDate now] forKey:@"purchaseDate"]; Then

Why are UIView frames made up of floats?

时光毁灭记忆、已成空白 提交于 2019-12-30 11:05:27
问题 Technically the x, y, width, and height represent a set of dimensions that relate to pixels. I can't have 200.23422 pixels so why do they use floats instead of ints? 回答1: The reason for the floats are that modern CPUs and GPUs a are optimized to work with many floating point numbers in parallel. This is true for iOS as well as Mac. With Quartz you don't address individual pixels, but everything you draw is always antialiased. When you have a coordinate 1.0, 1.0 then this actually adds color

iOS Project Update Xcode 4.2 to Xcode 4.5

馋奶兔 提交于 2019-12-30 08:23:46
问题 In my Project I have done 90% development using XCode 4.2 (was only need to support 4.x,5.x), Now I need to Build for iOS 6 as well, so I switched to Xcode 4.5 & iOS 6. But I am facing lots of issues like framework error for "Sqlite3", "MobileCoreServices" I have read below Thread but no success. How to make Xcode 4.5 project work on previous version of Xcode? Xcode linker Directory not found for option Can anyone please tell me How can I compile "Sqlite3", "MobileCoreServices" frame work for

How do I post a NSNotification when using Grand Central Dispatch?

╄→гoц情女王★ 提交于 2019-12-30 07:11:05
问题 I found that as predicted when I was writing an image to file that my UI was blocked for the duration, which was not acceptable. When I write the image to file I then post an NS Notification so that I can do some other specific jobs related to that completion. Original working but UI blocking code: -(void)saveImageToFile { NSString *imagePath = [self photoFilePath]; BOOL jpgData = [UIImageJPEGRepresentation([[self captureManager] stillImage], 0.5) writeToFile:imagePath atomically:YES]; if

How do I post a NSNotification when using Grand Central Dispatch?

你。 提交于 2019-12-30 07:11:04
问题 I found that as predicted when I was writing an image to file that my UI was blocked for the duration, which was not acceptable. When I write the image to file I then post an NS Notification so that I can do some other specific jobs related to that completion. Original working but UI blocking code: -(void)saveImageToFile { NSString *imagePath = [self photoFilePath]; BOOL jpgData = [UIImageJPEGRepresentation([[self captureManager] stillImage], 0.5) writeToFile:imagePath atomically:YES]; if

How to call [[UIScreen mainScreen] scale] in a universal app for the iphone and ipad

浪尽此生 提交于 2019-12-30 05:28:05
问题 I'm making a universal app that will run on both the ipad and the iphone. So far so good, but I have just updated my SDK to ios4 and am wanting to call [[UIScreen mainScreen] scale] (scale is not in the 3.2 sdk and the ipad doesn't have ios4 yet). I know that I can call [[UIScreen mainScreen] respondsToSelector:@selector(scale)] to find out if I can call it, but I still need to have the function call (and be able to access the return value) in my code so that it can run on the iphone. EDITED:

How to split items in a string separated by “,”

爷,独闯天下 提交于 2019-12-30 04:58:15
问题 In my App, data comes in String like this "Hi,Hello,Bye" I want to separate data by "," How can I do that? 回答1: use componentsSeparatedByString: NSString *str = @"Hi,Hello,Bye"; NSArray *arr = [str componentsSeparatedByString:@","]; NSString *strHi = [arr objectAtIndex:0]; NSString *strHello = [arr objectAtIndex:1]; NSString *strBye = [arr objectAtIndex:2]; 回答2: NSString *str = @"Hi,Hello,Bye"; NSArray *aArray = [str componentsSeparatedByString:@","]; For more info, look at this post. 回答3: