iphone-sdk-3.0

how to find multiple files with wildcard expression in objective-c

◇◆丶佛笑我妖孽 提交于 2019-12-01 10:55:18
问题 How do I get hold of all the *.bmp files (or *.xyz in general) in my Document folder, writing an iPhone 3.0 SDK? 回答1: You need to use NSFileManager 's contentsOfDirectoryAtPath:error: function. Note that this does not traverse subdirectories and extension cannot contain a . . -(NSArray *)findFiles:(NSString *)extension { NSMutableArray *matches = [[NSMutableArray alloc]init]; NSFileManager *manager = [NSFileManager defaultManager]; NSString *item; NSArray *contents = [manager

Error 403 while getFollowers : Twitter Iphone MGTwitterEngine

陌路散爱 提交于 2019-12-01 10:40:31
I am using Twitter-OAuth-iPhone https://github.com/bengottlieb/Twitter-OAuth-iPhone I am calling [twitterObj getFollowersIncludingCurrentStatus:NO] for getting my friend list which was working fine. But from last two days its giving me the 403 error. -- Twitter Request FD751461-39C4-4EAB-A0F7-D1ED262B19EA failed with error: Error Domain=HTTP Code=403 "The operation couldn’t be completed. (HTTP error 403.)" As twitter api wiki 403 is due to crossing the limit of updates and DM but here in getFollowersIncludingCurrentStatus Why this error occurring and even list is not comes next day giving same

How to call function in every “X” minute?

自作多情 提交于 2019-12-01 09:56:39
问题 I was trying to make a sample iphone application to update current location. I have a function that logs the current location, "logCurrentLocation", but I have no idea how to call this function automatically in every X minutes( or seconds). Please advise me which method I need to look at in the apple documentation. Thank you for your help. sung. 回答1: Check out the documentation for NSTimer. It allows you to schedule a timer which will call a function (defined by a "Target" object and a

How to add contact from within an iPhone app?

心不动则不痛 提交于 2019-12-01 09:27:47
问题 I am looking to keep track of people in my iPhone app - either adding them from existing contact data, or prompting the user to enter a new contact which will be saved to their Contacts. I know I can create a persons record add write it to the Contact book, is it possible to display this screen ? Or do I have to implement my own view to facilitate creating a contact entry? 回答1: Apple provides ABNewPersonViewController . If you'd like some sample code, see Quick Contacts, in particular, this

What's going on with “expected specifier-qualifier-list” error

独自空忆成欢 提交于 2019-12-01 09:27:40
问题 It is my GameEngine.h: #import <Foundation/Foundation.h> #import "GameArray.h"; @interface GameEngine : NSObject { GameArray *gameButtonsArray; } @property (nonatomic, retain) GameArray *gameButtonsArray; And this is my GameArray.h: #import <Foundation/Foundation.h> #import "MyAppDelegate.h"; @interface GameArray : NSObject { NSMutableArray *gameButtonsArray; } @property (nonatomic, retain) NSMutableArray *gameButtonsArray; It keep prompt my "expected specifier-qualifier-list" error i my

EXC_BAD_ACCESS on device, but fine on Simulator

杀马特。学长 韩版系。学妹 提交于 2019-12-01 09:19:48
I have a scroll view app which runs fine on the simulator, however, when installed on the device, it gives me an EXC_BAD_ACCESS, when i attempt to scroll one page. I have ran it through Instruments with Allocations and Leaks, but nothing is leaked and no zombies are messaged... i'm just curious what could cause such a difference in simulator vs device? Any ways to debug this, since my symbolicated crash log (partial below), doesn't seem to be very symbolicated. Exception Type: EXC_BAD_ACCESS (SIGBUS) Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000f Crashed Thread: 0 Thread 0 Crashed: 0

iPhone : Insert Contact to Address book without any User Interface [duplicate]

≯℡__Kan透↙ 提交于 2019-12-01 08:46:59
This question already has an answer here: Add Contacts into AddressBook without UI 2 answers I am working on Address book and Contact related functionalities. In that I want to add contacts to my device without any user interaction. Using ABPerson class we are getting some user interface but my concern is I do have contacts on my own server and I want to copy all from the server to my iPhone. So If there I will use a user interface then it will consume a lots of time. So can any one help me out from this situation Thanks in advance, kamalesh kumar yadav complete answer to add contact to

Using GraphicsServices.h/GSEvent as well as compiling CLI iPhone tools with Xcode

拜拜、爱过 提交于 2019-12-01 08:21:37
I sent this to KennyTM (has all the private framework headers on GitHub) but I figured I'd ask here too just in case someone has some good ideas or any way to help me out. I'm trying to write a command line utility that sends GSEvents to operate the keyboard, touch/drag elements onscreen, and operate hardware buttons (volume, home, sleep, etc.) I grabbed the MouseSupport code and tried to look through it, but I couldn't find the easiest way to send GSEvents. I'm hoping someone here can help me. First, what's the simplest way to declare a GSEvent and send it? I looked at the iPhone development

How to passing a NSMutableArray to another ViewController class

偶尔善良 提交于 2019-12-01 07:34:26
问题 I have created NSMutale Array in "HeroListViewController" . I want use it in another viewController which is MapTutorialViewController . I tried like this. in HeroListViewController.h MapTutorialViewController *maptutorialcontroller; NSMutableArray *listData; set properties and synthesize them correctly in HeroListViewController.m - (void)viewDidLoad { [super viewDidLoad]; listData = [[NSMutableArray alloc] init]; } - (UITableViewCell *)tableView:(UITableView *)theTableView

How to use NSNumberFormatter for currency to print in UITextField

大兔子大兔子 提交于 2019-12-01 07:03:40
问题 I am a N00b here . I print my currency like this : -(IBAction)buttonPressed1:(id)sender { double currency = [Amount1.text doubleValue] + [Amount2.text doubleValue]; SumCurrency.text = [NSString stringWithFormat:@"%0.0f", answer]; } I just simply want to use NSSNumberFormatter to print the SumCurrency.text in US Currency format .. Having a lot of trouble with it ..Please hekp same issue ??? http://groups.jonzu.com/z_apple_using-a-nsnumberformatter-with-a-uitextfield.html Thanks in Advance .