ios4

best way to load an image library of iphone nsmutablearray (600+ items)

偶尔善良 提交于 2020-01-03 06:27:29
问题 I have created an app which has a library of images. I have imported the images in to my resources folder in Xcode and am currently loading them in to an array in the appDelegate when the app loads. This is happening each time. I am now worried that as the library grows the app will run out of memory. Is there a better way of loading these? the structure is Library > category > image list > image I have an NSMutableArray called mainLibrary which I then add another nsmutablearray for each

pdf parsing problem

此生再无相见时 提交于 2020-01-03 05:09:21
问题 hi im working on pdf viewer. i want to extract all the contents of the pdf. will cgpdgscanner get all the contents of pdf?? the apple documentation is very brief. its difficult to implement with the explanations given. and lots of googlin also leads to nowhere. so can someone explain the use of the purpose and use of the following: 1.CGPDFOperatorTableRef 2.CGPDFOperatorTableSetCallback 3.CGPDFScannerRef 4.CGPDFContentStreamRef once al this is done how to view the data that is got after

How to check Facetime Support in iOS devices (hardware check)

廉价感情. 提交于 2020-01-03 05:01:10
问题 I want to check if iOS device I am using has support for Facetime call. I don't want to check the iOS version on the device, rather if the device has the hardware support to initiate a Facetime call. For example: I have an iPad 1 with iOS version 4.0 and above, but if I don't have a camera (or a front camera), the Facetime call should not initiate. How can I do this? 回答1: Try using canOpenUrl method with FaceTime scheme, as follows: [[UIApplication sharedApplication] canOpenURL: [NSURL

My program has a memory leak

冷暖自知 提交于 2020-01-03 03:04:22
问题 -(IBAction)play2; { CFBundleRef mainBundle = CFBundleGetMainBundle(); CFURLRef soundFileURLRef; soundFileURLRef =CFBundleCopyResourceURL(mainBundle, (CFStringRef) @"Bear3", CFSTR ("wav"), NULL); UInt32 soundID; AudioServicesCreateSystemSoundID(soundFileURLRef, &soundID); AudioServicesPlaySystemSound(soundID); } This is giving me an error: potential leak of an object allocated " CFBundleResourceURL returns a Core Foundation object with a +1 retain count 回答1: AudioServicesCreateSystemSoundID

Does iOS support Bluetooth SPP?

核能气质少年 提交于 2020-01-03 01:34:24
问题 I want to develop an ios application that communicates with another bluetooth supported device via Bluetooth SPP. Does iOS support SPP? I checked iOS supported profiles bu couldn't see anything about SPP.. http://support.apple.com/kb/ht3647 So, is there any other way for using SPP ? Thanks.. 回答1: No, unfortunately Apple (iOS) Bluetooth does not support SPP. In order to make a serial cable communication to an iOS Device you have to use the Authentication CoProcessor. I guess from that reason,

iphone sdk 4.1 memory leackage: may be scene replace problem (cocos2d)

大憨熊 提交于 2020-01-02 23:02:58
问题 I have used scheduler to return from a scene to the main menu. There is nothing in the scene page except menu. But scenes are not deallocating and memory leakage increasing as i navigate through the scenes. So application is not closing(kept running in background when close using iphone/ipod button) but crashing. Hope some of you faced and resolved this type of problem.Expecting a way to out from here. Here are my class sources- Delegator @implementation BubbleWordAppDelegate @synthesize

How to convert date string into format “17 Nov 2010”

流过昼夜 提交于 2020-01-02 23:02:39
问题 I have the date that is in format 2010-11-17 .This is of the form NSString . I want to convert this NSString date into format 17 Nov 2010 and display in a label This date is just not the current date but may even be the older dates. So I cant use the [NSDate date] instance to get the date. I tried using NSDateFormatter with the method dateFromString . But it gives me a null value. Here is the code snippet NSString *dates = @”2010-11-16”; NSDateFormatter *dateFormatter = [[NSDateFormatter

iOS 5 Region Monitoring: Can new regions be created based on users current coordinates from coreLocation?

风格不统一 提交于 2020-01-02 18:24:12
问题 My question is regarding the creation of regions for regionMonitoring in iOS 5. Can new regions be created based on user of the app's current location? Or do all regions need to be predefined by the developer in the applications binary? I know you can have certain regions register based on the users current location, because the os puts a limit on the number of regions that the phone/app can be monitoring at one time, and you should only register the regions within close proximity to the

NSDictionary Filtering and Sorting

…衆ロ難τιáo~ 提交于 2020-01-02 10:23:53
问题 I am working on a App that makes use of a JSON API and I am Using the JSON for Objective C Framework to get the Data into a NSDictionary . The dictionary loos like this: ({ admitted = "<null>"; agreed = "<null>"; "area_id" = 1; "area_name" = "Digitales, Urheber-/Patentrecht, Datenschutz"; created = "2010-08-17 12:41:03"; "current_draft_content" = Bla Bla Bla"; "current_draft_created" = "2010-08-17 12:42:44"; "current_draft_formatting_engine" = compat; "discussion_url" = "http://piratenpad.de

How to show single annotation pin for a region when i have multiple coordinates for that region?

南笙酒味 提交于 2020-01-02 09:23:50
问题 I am working on the map application and as per requirement i need to show a single pin for a single region even if it has multiple user coordinates when its completely zoomed out but when its zoomed in to the map then i should display all the pins as per its coordinates. I have given example below to explain my problem. I have city New York on this city I have 100 pins on my mapview when I am zooming out of my map it should show me only one annotation pin on the place of 100 pins but when I