objective-c

Problem provisioning iPhone after 3.0.1 update

I used to be able to run my application on my iPhone that was running 3.0. After I updated to 3.0.1 I get the error: No Provisioned iPhone OS Device is Connected. I followed Apple's guide in the terminal: ln -s /Developer/Platforms/iPhoneOS.platform/DeviceSupport/3.0\ \(7A341\) / Developer/Platforms/iPhoneOS.platform/DeviceSupport/3....

Model instantiation question when using Core Data

I'm slightly confused in one aspect of Core Data. That is, when do I use the rudimentary alloc/init routine vs created an object with core data and saving it into the current managed object context. I know that's a rather vague question, so let me give you an example. I have an application I'm currently working on that iterates through...

Rounded UIView with Shadow?

So using this link: http://stackoverflow.com/questions/805872/how-do-i-draw-a-shadow-under-a-uiview And this link: http://iphonedevelopment.blogspot.com/2008/11/creating-transparent-uiviews-rounded.html I came upon this implementation: - (void)drawRect:(CGRect)rect { CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSav...

Why does Core Data create NSManagedObject's with properties but no accompanying instance variable?

Exactly as the title says, why does Core Data create instances of NSManagedObject with properties for each entity's attribute, but no accompanying instance variable? The problem is, I would like to use some of my 'Entities' in a typical alloc/init style fashion in some parts of my code. Not using Core Data's fetching/context to create/st...

Retaining an object created in an NSThread

I have the following method which is spawned by a call for a new thread (using NSThread): - (void) updateFMLs { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSArray *temp = [[NSArray alloc] initWithArray:someArrayFromAnotherProcess]; [self performSelectorOnMainThread:@selector(doneLoading:) withObject:temp...

Resolving a remote $HOME directory via FTP/SFTP.

In Objective-C, NSString has a method called stringByExpandingTildeInPath This method will take a string like "~/Documents" and resolve it to "/Users/Nick/Documents". The "~" tilde is resolved to the home directory of the current user of the machine the program is running on. Now my question is this... I am writing a little FTP/SFTP ...

Can I start a thread by pressing a button in a cocoa interface and keep using interface while thread runs?

I have a Cocoa interface. When I press a button I want to process some data, but I want to keep using the interface while it's working. I guess the only solution is NSThread. Now will there be a locking mechanism preventing me from returning from an IBAction method if it spawns a thread? ...

How to save and view a pdf file through an app on iPhone?

Hi All, I am trying to save a pdf file in SQLite. I think it will be possible by saving the pdf file as blob. And the problem starts here, how to view that file within the iPhone app now? I know it can be done using this code:- @interface PDFViewController : UIViewController { UIWebView *webView; NSURL *pdfUrl; } ...

Objective-C : Mistake BOOL and bool ?

I already found out that bool is a C-Type while BOOL is an Objective-C Type. bool can be true or false and BOOL can be YES or NO For beginners it can be hard to distinguish these types. Is there anything bad that can happend if I use bool instead of BOOL? ...

iPhone Facebook Application Login Problem

Hello everyone, I am trying to implement Facebook functionality on iPhone using Facebook API. In my application I can open the Login screen, but when I enter Email and password and press "Connect" button there nothing is to be happen. And after sometimes I will be back in my previous screen. I have used FBConnect bundle. I can't understa...

biginteger on Objective-c

Can anyone provide code for a biginteger implementation in objective-c that provides a PowMod function ? ...

Problems with Drag and Drop in an NSOutlineView.

The problem I have is that I have an NSOutlineView with Drag and Drop (see the bottom of post for code to make drag and drop work), it works, but when I drag one row into another row the dragged row becomes a child but it also stays where it was as a parent, and when I delete either row both of them get deleted. To show you what I mean,...

What is something you wish you had known sooner about the iPhone SDK?

I'm interested in picking up some tips and tricks while learning about the SDK. What I am looking for something that you wish you had known getting started that would have benefited you now. ...

how to draw a maze using openGL for iphone development?

Hi, I was wondering if anyone can get me started on how to build like a maze using openGL. Would i need to write code to draw the maze or is it like painting a picture in a separate window? would i need to create a game engine to start with this? I'm doing this for iphone development so any suggestions for that would be a great start for...

why is textFieldDidEndEditing: not being called?

I'm playing with writing my first iphone app; SDK 3.0. I've got a UITextField, and when text gets entered into that, I want to obtain the doubleValue from the text field and perform some computations and display them in a UITableView. The delegate for the UITextField adopts the UITextFieldDelegate protocol, and implements both textFiel...

Accidentally calling the same obj-C object twice

I want to make two separate asynchronous internet lookups. However, they are stepping on each other and I'm not sure why. When I dig around, it appears the two lookups are both operating on the same object (symptom: the second call is resetting "thisPage" set by the first call). Maybe this has something to do with delegate usage (stil...

How can we use CSS for developing native iPhone app?

Hi All, I am not developing any web app. I am trying to use CSS in developing iPhone native app. I am confused about where to include it and use it . Whether to use it in the viewDidLoad or applicationDidFinishLaunching . I am really getting tired of using the same UI look. Can any body help me? Thank You All. ...

NSCollectionView not updating subviews on data change

I have set up an NSCollectionView through Interface Builder. My prototype view contains a progress indicator and a text field. I have set up the bindings so that my "task" object maintains the value of the progress indicator and the text field value. It all works okay when I add new objects to the collection (via [NSCollectionView newIt...

NSLog(...) improper format specifier affects other variables?

I recently wasted about half an hour tracking down this odd behavior in NSLog(...): NSString *text = @"abc"; long long num = 123; NSLog(@"num=%lld, text=%@",num,text); //(A) NSLog(@"num=%d, text=%@",num,text); //(B) Line (A) prints the expected "num=123, text=abc", but line (B) prints "num=123, text=(null)". Obviously, printing a lon...

iPhone Dev - Delegate or event?

In many situations, such as making the keyboard go away when the use clicks done, there are two options: set the text field's delegate to self, and adopt the UITextFieldDelegate protocol, and then use the method - (BOOL)textFieldShouldReturn:(UITextField *)textField; to resignFirstResponder and return YES. But you can also addTarget:self...