objective-c

How do I find working examples of Cocoa/Carbon API?

I find it hard to find some working examples of Cocoa/Carbon framework functions, whereas there are well documented function prototypes from Apple. For example, LSOpenItemsWithRole function has well defined prototype, but I guess some examples would be a great help for a mac programming beginners like me. How can I find some working ...

Help in creating multi Page PDF in iPad

Hi all, I am developing an application in which i have to create multi page PDF and email that pdf. The content which is to be converted to pdf contains text as well as some images. I have seen some posts regarding this but could not glean too much from it.Will be greatful if any one can guide in this. Thanx, Regards, tek3 ...

What's the difference between 'atomic' and non-atomic?

Hi all, I just want to know what is the differneve between theses two lines of code : @property(nonatomic, retain) NSString *str; and @property(atomic, retain) NSString *str; Thanx, Regards, tek3 ...

Check a float variable for existence.

I have to check a float variable to determine the existence of a particular variable. Ideally it should have been a bool value or at least an int. Because of interface constraints and legacy code I am not able to change the data type to bool. So if I've to make a check, can I directly do it as shown below in the sample code: void c...

Animating UINavigationController's 'back' button

I have a custom button on a view controller in the navigation controller's heirarchy, that when pressed, pops the visible view controller. I want to use UIView's transform property to animate the closing of the view controller. It works, but if I use `popViewControllerAnimated:YES', the default left slide of the animation is still ther...

Why retain count is bigger, than I expect (using addSubview)

Why counter variable equals 3, not 2? @interface ScoreView : UIImageView ... - (id)initWithFrame:(CGRect)frame { if (!(self = [super initWithFrame:frame])) return self; _scoreLabel = [[UILabel alloc] initWithFrame:CGRectMake(0,0, 10, 10)]; [self addSubview:_scoreLabel]; int counter = [[[self subviews] ob...

What is the most basic class in C++

I hope this question is not too silly, but what is the most basic class in standard C++? object? Object? class MyObject : public object{ ... and I get "Expected class-name before token{" Is there any map, diagram or image that shows standard c++ classes inheritance? Something like this but for C++ ? ...

Cocoa and REST: Should API details go in the model or in an API class?

I have a RESTful server and need to create the client in a Cocoa app. I have a model called Resource. When I GET /resources, my server returns all resources in JSON. I have a model called Client that owns many resources. The Client has an instance method -(NSMutableArray*)resources An NSArrayController manages the resources. The firs...

presentModalViewController crashes simulator

Hi everyone I have a very weird situation, check out the snippet below which launches a ModelViewController for an iPad application: // Load GuestDetailController GuestDetailController *detaileController = [[GuestDetailController alloc] init]; if (searching) { // some code, but nothing relevant to the issue (checked that already) } ...

Maximum size of UIImage tiles for iPhone 4

I have an iPhone app containing a large static image, which is sliced into 1024x1024 tiles and put in an UIScrollView. I'm not clear whether I can use larger tiles on the iPhone 4. If I want to support a double-res image for iPhone 4, should I: Create 2048x2048 tiles with a @2x suffix or Create 4 times as many 1024x1024 tiles and writ...

Why Objective-C properties are sort of inconvenient?

It is more of a complain than a question, though maybe someone has some good points on it. So basically if you want an ivar in your Objective-C class have accessor-methods you have to mention it 3 times SomeClass* _ivar; @property (nonatomic,retain/assign/copy) SomeClass* ivar; @synthesize ivar = _ivar; and maybe 4th time in dealloc m...

Is it possible to fire up a pop up like windows from a UIWebView?

How can I make a UIWebView's html/javascript to trigger a UIModalView to show up on page load? ...

Why is viewDidUnload called less often than viewDidLoad?

I put NSLog(@"%@::%@", [[self class] description], NSStringFromSelector(_cmd)); in both viewDidLoad and viewDidUnload of a view controller. In the log, I found viewDidLoad is called a lot more than viewDidUnload when the app moves to and from different .nibs. Why? ...

How to display the UITableView programmatically?

Hi, everyone, I want to ask a question about the UITableView of the objective C. I am writing a program and I would like to create the UI programmatically. However, I don't know how to display the table programmatically. I already have a NSMutableArray to store the displayed data. And I create a object UITableView *tableData;, what sho...

probelem with NSTimer

Hi I have a problem with a NSTimer I recived a "SIGABRT" error and "[NSCFTimer intValue]: unrecognized selector sent to instance " These is my code: -(void)detectionMove:(NSNumber*)arrayIndex{ static BOOL notFind = FALSE; static int countVariable = 0; static int countRilevamenti = 0; notFind = FALSE; for(int i =...

Recommended document structure. File Wrappers? Roll my own?

Hi, I'm currently working out the best structure for a document I'm trying to create. The document is basically a core data document that uses sqlite as its store, but uses the Apple provided NSPersistentDocument+FileWrapperSupport to enable file wrapper support. The document makes heavy use of media, such as images, videos, audio files...

Why am I seeing the error "Format is not a string literal and no format arguments"?

Hi all, i am creating a music application in iphone where i am integrating twitter in my iphone so that a user can listen to a particular song click on the twitter tab ,log in to twitter and post his comment in to twitter.and i need that his username and password should be saved when he click on save username and password button so that...

how insert data to remote database from ip+phone Application

hi all. I am accessing a php website in my iphone application. i want that user read the blogs in their iphone application and when they comments on any blog their comment are stored in the website database. any idea how to do this. OR what i need to study to Talk with remote database..... Thanks In advance. ...

how to add a contact from my app to iphone address book

I would like to implement the ability to save a contact (phone number, name, address and email) in the iphone address book by clicking on a button in my application! How can I do this? ...

iPhone 4 640x960

Possible Duplicate: How to differentiate between iphone4 and iphone 3 Well, I know all the @2x stuff and already read the other stackoverflow threads and apple reference regarding the retina display and high res support to no avail. I'm loading an image from a remote server which supports a resolution request parameter. For ...