objective-c

Dismiss / Present Modal View Controller - Memory ?

Hi all, When you dismiss a modal view controller is that view controller object destroyed ? Also if you represent the same view controller again does it load from fresh - e.g is the "view did load" and "init" method called ? ...

Cocoa Touch: are dynamically XML-defined views possible?

Hi all, first post. Been an iPhone developer intern for about five weeks now. I've read a lot of introductory Apress material, but please take it easy if I make some vocabulary violations. So far I've been able to find answers by searching and lurking. However I now have a task for which I can find little relevant information. My iPhone...

How to call a selector in a different class

How would this code be different if the method was in a different class? [saveButton addTarget:self action:@selector(saveArray) forControlEvents:UIControlEventTouchUpInside]; ...

NSMetadataQuery and NSDate: precision problem

Hi, I was using NSMetadataQuery to find files which creation date is more recent than a NSDate. It seems that NSMetadataQuery cannot find files which creation date is more recent than the specified NSDate for one hour. I mean if the creation date of a file is today at 12:10:50, the query return no result if I set today 11:10:49 as NSDate...

UINavigationController always loads table view with same data

I have a navigation controller based app. My views consist of two tableviews laid out like this: Category Item within category Basically i allow users to create the categories using the + button on the navigation bar. Then they select a category, and can then press the + button again to create items in that category. My problem ...

UIImage copy ends up rotated

I am trying to copy a uiimage (ultimately I am planning to blur the copy). Right now the copied image shows correctly in the simulator but ends up rotated 90 degrees when running on the device. I am using the following to create acopy: CGImageRef cgImage = [sourceImage CGImage]; // Make a new image from the CG Reference UIImage *c...

Positioning data inside UIWebView

I have an image I am loading into a UIWebView as such: NSData *data2 = [[NSData alloc] initWithBytes:sqlite3_column_blob(selectstmt, 7) length:sqlite3_column_bytes(selectstmt, 7)]; if(data2 != nil) { [webView loadData:data2 MIMEType:@"image/png" textEncodingName:nil baseURL:nil]; webView.backgroundColor = [UICo...

How can I set my Base SDK?

I want to be able to support iOS 3.x users. When I try to set the Base SDK in Project Info, the only SDK that appears is iOS 4.1 and iOS 3.2. How can I add additional SDK's so I can support older users when my app hits the App Store? ...

How to use NSLineSeparatorCharacter and NSParagraphSeparatorCharacter?

I wonder how I can use the constants NSLineSeparatorCharacter and NSParagraphSeparatorCharacter as a parameter to a function instead of hard coding \n. - (id)initWithSeparator:(id)separator { m_separator = separator; } What would be the correct parameter type and what conversion needs to be done? Depending on the file contents I wish...

Repeat alloc to same pointer - what happens ?

HI all, What happens if you repeat the following code more than once ? pointer * mypointer = [[object alloc]init]; Do you just increase the retain count of that object by one again ? Thanks, Martin ...

Programming an app similar in appearance to the Facebook app

Hi everybody I'm programming an iPhone application. This application contains a home page, which I would like to be almost the same as the one in facebook for iPhone : rows of icons, each icon corresponding to a category of my application. I'm a newbie in iPhone development, and I can't find which control is used to show this view. Cou...

Objective-C Method Signatures. Are they inconsistant?

Hey, I'm a newbie to Objective-C, but please help me out here. What I'm seeing is that Method signatures in Objective-C that take multiple parameters seem inconsistent. Example: - (void) sendEmail: (NSString *) toStr subject:(NSString *) subjectStr body:(NSString *) bodyStr; Ok, so here we have 3 "parameters" (at ...

API for Wikipedia in Objective C?

Hi there, Does anybody know if there is an implementation of the wikipedia api in objective c? which can be used to access and display the information a bit nicer then with the plain website. I'm thinking of something like the wikipanion app but not so sophisticated. Thanks Joerg ...

IPhone App Submission Problem

I have finally gotten my first app to work properly and I'm attempting to send it to the App Store. In my Application Loader, I'm getting this error: Info.plist does not contain a CFBundleResourceSpecification I have read on the following SO question that this could be because I am Building on the simulator and then zipping up the app...

Custom Cell UITableViewCell

Hi, I am trying to create a custom cell with an imageview, button, textview, and a label #import <UIKit/UIKit.h> @interface CustomCell : UITableViewCell { IBOutlet UILabel *nameLabel; IBOutlet UITextView *inputText; IBOutlet UIImageView *image; IBOutlet UIButton *btnBuy; } @property (nonatomic, retain) IBOutlet UILab...

Disabling and delaying an IBAction button

I have an IBAction button that I would like to enable after a 30 second delay. the button would be in the view but disabled for 30 secs. does anyone know how I would go about doing this? here's what I have - a simple IBAction that plays some audio: -(IBAction) playSound:(id)sender { [theAudio play]; } thanks for any help. ...

How to set a NSView hidden with FadeOut animation in cocoa?

I'm hiding a subview from a CustomView element with the following code: [[[theViewcont subviews] objectAtIndex:0] setHidden:TRUE] how can i add a fade animation on hiding this NSVIEW? ...

How to declare class array in objective c

I can declare NSMutableArray or NSArray but I want to declare class array. Let say user is a class so I can declare array as: user* obj[10]; it is valid in Objective c, but I am not sure how I can set array capacity dynamically. Which we usually do with MutableArray as initWithCapacity:.. This is what I am doing with class: user* o...

How can I understand this crash log?

Looks like its related to NSURLConnection, but not sure how I can diagnose? Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x1ab98c00 Crashed Thread: 0 Thread 0 Crashed: 0 libobjc.A.dylib 0x000027da objc_msgSend + 18 1 CFNetwork 0x000...

How to store CGRect and other things in core data

I'm having a few teething problems with coredata, but feel it would clear things up for me greatly if someone could explain some simple cases to me. I want to put my model into coredata, and at a most simple case take advantage of undo/redo. Thing is, all the examples I see tend to store either strings or integers. What if I have a clas...