objective-c

With...End With VB6 Statement like Statement in objective-c

Wondering if we have something like vb6 with..End With Statement in Objective-c? Example: With Object .a = "aaa"; .b = "bbb"; End With I know that there is something called blocks concept, but i am not sure whether it is available in 10.5 Leopard. Thanks ...

my colour bitmap is only black and white in drawRect (iPhone)

I want to preserve previous drawing in drawRect (the system clears it down each time) and it seems that the way to go is to use a bitmap context and sure enough, this works except that now my colour is gone leaving only black and white instead. Here is my "static" context -(id)initWithCoder:(NSCoder *)aDecoder { ... CGColorSpaceRef co...

Xcode 4: How do you view the console?

I can't seem to find a way to have the console run (to show NSLog comments) in XCode 4. The normal method for the previous version of XCode does not work. Does anyone have an idea of how to accomplish this? ...

How to use finalize method in Objective-c?

How to call finalize method in Obj-c for garbage collection? ...

unable to open database

I am using below code for inserting data in the database. and i am inserting aprox 15000 records but after 245 records it throws the error "Unable to open database" +(void)addGeoRegions:(const char *)query geoId:(int)geoId geoFatherId:(int)geoFatherId geoName:(NSString *)geoName geoTypeRegionId:(NSString *)geoTypeRegionId geoZo...

convert number to words ,in objective c

hi all, I need to write numbers like: 1>yek 123>yeksad o bist o se 1,123>yek hezar o yeksad o bist o se 3,002,001>se milion o do hezar o yek ... I,m beginner in objective c :) I write it in c but I want to convert it ,into obj_c! How can i do that? somthing like: const char *yekan[10]={"","yek","do","se","chahar","panj","shes...

Insert NSDictionary

hi, I have a question. If i have a NSArray i can put into a NSDictionary? If i can, how can do these? Thanks ...

understanding NSManagedObject

Hi all, in an existing project I have tried to introduce Core Data long after the project was created, so its model is already in place. I have created the xcdatamodel and added my only class to it. That class should act as a global storage for objects in my application. The class properly implement NSManagedObject and I have verified i...

FlipFromRight UIView animation

Hello guys! First here's my code: [_helperView addSubview:_navigationController.view]; [_helperView addSubview:itemView]; [UIView beginAnimations:@"pageFlipAnimation" context:nil]; [UIView setAnimationDuration:1.0]; [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:_helperView cache:NO]; [UIView setAnimatio...

Rotate UIImageView Depending on iPhone Orientation.

How would I do this, all I want to do is rotate a UIImageView depending on the orientation of the iPhone. ...

How to define and implement properties in protocol

Hi, I want to define one protocol with few properties and need to use those properties in another NSObject subclass. Please give me link or example code. I need that to work with 10.5. Thanks PLEASE CHECK THE FOLLOWING SAMPLE CODE @protocol MyProtocol @property (nonatomic, readonly) id someObject; @property (nonatomic, getter=is...

How can I join a string repeatedly?

Hello everyone. I want to do something like: string s1 set to null s2: "abc" repeat 10 times s1=s1+s2 How can I do this in objective-c? ...

XCode 4: How to send objects in NIB files to front\back?

How do you adjust the "z"-positions of objects (e.g. sending UIImageViews to the front\back) in the new, integrated interface builder in XCode 4? ...

Opening Images into OpenGL textures and saving textures as PNGs with Cocoa

Hello. There is a lot of conflicting information on how to open images with Cocoa for use with OpenGL. I want to open JPG and PNG files and save PNG files for my program which uses Cocoa on the Mac version. What is the best way to do these two tasks? Thank you. ...

Why is this NIB view not released before being returned?

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellId]; if (cell == nil) { [[NSBundle mainBundle] loadNibNamed:@"ThemeCell" owner:self options:nil]; cell = self.themeCell; self.themeCell = nil; } ... return cell; My understanding is that self.themeCell = nil; should destroy the object sinc...

programmatically create a pad sound

Okay this one may be a bit out from left field, but I'm going to try anyways. A pad is a sort of ambient electronic sound that kind of 'hums'. Something like this . How can I produce this in code? Using either Processing, OpenFrameworks, C, Objective-C or C++. Keep in mind I haven't been programming for that long. I will be very imp...

iphone: try end try

Is there in objective-C any way to see if it is possible to do a certain task without risking crash the application? Other languages like javascript have try { //Run some code here } catch(err) { //Handle errors here } is there something in Objective-C? If so, what is the syntax? thanks. ...

How to put iPhone UIDatePicker into 24 HR mode without affecting other apps?

Hello, My users was to select their times using the 24 HR clock instead of the AM/PM 12 hour clock in my iPhone app. Presently, as far as I can tell, the only way to put the UIDatePicker into 24 HR time mode is from the device's settings. My users only want 24 HR mode for this app, not their entire device. Does anyone know a way to p...

iPhone File Sharing: How to recognize when files have been added?

I have file sharing via iTunes working in my application (reference What's New in iOS 3.2) by enabling the UIFileSharingEnabled key, but according to the documentation: "Applications that support file sharing should be able to recognize when files have been added to the Documents directory and respond appropriately." My question is, i...

Can I use a continuous background thread to update the iPhone UI without using NSTimer?

Let's say that if I read from www.example.com/number, I get a random number. In my iPhone app, I want to be able to continuously read from that address and display the new number on the screen after each request is finished. Let's also assume that I want this process to start as soon as the view loads. Lastly, as a side-note, I'm using A...