objective-c

How To Create DataBase:

Hi friends, i am fresher to Objective-c language.so i need some guidance from familiar people like you.Especially i need to know how to create a database in Objective-c with sqlite3 weapon.If any of you interested to help,please go ahead.Thank you. ...

How to Access Objects from one ViewController to another ViewController.

Hi friends, Provide some tips to get rid of the following scenario. description: I had two viewControllers namely ViewController1 and ViewController2,so obiviously we have ViewController1.h,ViewController1.m and ViewController2.h,ViewController2.m. Now i declared an NSString *string1; in ViewController1.h and declared as a prop...

Custom UINavigationBar Background

I've been trying to set up a custom background for the whole of my NavigationBar (not just the titleView) but have been struggling. I found this thread http://discussions.apple.com/thread.jspa?threadID=1649012&tstart=0 But am not sure how to implement the code snippet that is given. Is the code implemented as a new class? Also whe...

Chaos with InterfaceBuilder

Hi Friends, Please clear this scenario. I created a viewController named RootViewController,so obiviously we'll get RootViewController.h and RootViewController.m Then i created a nibfile named ViewScreen.xib by selecting a newFile named viewXib, so automatically we'll get a View in the xibfile.And i linked FilesOwner class to RootVi...

Objective-C Asynchronous Web Request with Cookies

I am writing a program in Objective-C and I need to make web requests to web server, but asynchronously and I am fairly new on mac, I am very good at windows technologies, but I need to know that if I use NSOperation (introduced in 10.5, i am assuming that it will not run in 10.4 MAC?), or if it was implemented such that it utilizes syst...

parse mail to fetch attachments

Hi, how do I parse a mail in Cocoa? I've read the NSScanner tutorial, but struggled. Do you know any better way than NSScanner? Is there any sample code? My example: http://pastie.org/private/pordph27stkwkyvrx2tiq Regards ...

What's wrong on following URLConnection?

See also: Objective-C Asynchronous Web Request with Cookies I spent a day writing this code and can anyone tell me what is wrong here? WSHelper is inherited from NSObject, I even tried NSDocument and NSObjectController and everything.. -(void) loadUrl: (NSString*) urlStr{ url = [[NSURL alloc] initWithString:urlStr]; reque...

Is an NSMutableString in this case more efficient than NSString?

If I declare a pointer variable in this fashion: NSString *foo; And then somewhere later in my code do something such as: foo = @"bar"; Is that ultimately taking my NSString, creating a new copy in memory with an additional string, then deleting my initial string? Would foo be better off as an NSMutableString? ...

CoreAudio AudioQueue i/o redirect to/from phone app?

I've been reading up on some of the iPhone audio services in considering an audio recording/playback app, but ideally I'd like to be able to use the other end of a phone connection as inputs and outputs, i.e. remote speaker and remote microphone via cellular (or VoIP, but for now cellular's the question), when it's on, as input and outpu...

static BOOL in Objective C

In the following code, I'm creating a category on UIColor to create a random color. However, from this code, I would have thought that the 'if' conditional would be true every time the method is run, instead of just the first time. I think I'm not really understanding static variables correctly. Does a static variable only get set ...

typedef enum in Objective C

I don't think I fundamentally understand what a enum is, and when to use it. For example: typedef enum { kCircle, kRectangle, kOblateSpheroid } ShapeType; What is really being declared here? ...

How should I memory manage objects returned by instance methods?

Plenty of Objective-C classes return objects. Statements like [[instanceOfNSWhatever objectForKey:aKey] stringValue], for instance, appear all over my (and hopefully everyone else's code). How am I supposed to memory manage these "intermediate" objects? Were they just created or did they always exist? Can I retain them, and if I relea...

iphone-sdk, sharing data between multiple views

Take the following example.. A single tabBarController toggles between two views, each handled by their own view controller (lets say viewController1, viewController2). I have a class called Widget that has the property 'name'. So i have code in view1 that will read the contents of a textfield and set the 'name' property of my widg...

Why is self.navigationItem.hidesBackButton not working?

I have a UIViewController that is pushed onto a UINavigationController and is currently displayed. When I go to start some asynchronous task inside the view controller, I can set hidesBackButton on self.navigationItem to YES, and the back button is hidden correctly. As soon as the task is finished, and I set hidesBackButton back to NO (...

How to reference property on library

I'm referencing another project's target static library. I successfully followed instructions from this site: http://tinyurl.com/cleuhw. Below is the project using a class named FileIO from the library. I create a FileIO object (fileObj) and assign a string to its name property. Then I get a __TERMINATING_DUE_TO_UNCAUGHT_EXCEPTION__ ...

Automatic code generation for Objective C to C++ bridge

I am seeking an opinion from the Mac/iPhone developers about a new project. The idea is to start an open source initiative using swig (www.swig.org) for automatically generating the bridge from objective c to c++ so that one can access c++ applications from cocoa/cocoa touch. Apple provides a very good support for mixing objective c and...

Creating a library that contains instance members

In regards to my a little to late discovery that static libraries (obviously) can't have instance members, http://stackoverflow.com/questions/708155/how-to-reference-property-on-library/708263#708263, is there a way to create a shared library that contains both instance and static members? On way that probably works is to create a class...

Play a short audio while recording ?

Hello all ! I need play a short audio while recording. Run on Simualtor is very well but can't play audio when on device while recording . I see SpeakHere example and change "kAudioSessionCategory_RecordAudio" to "kAudioSessionCategory_PlayAndRecord". Anybody help me ? Thanks a lot. ...

What is this Objective-C syntax, ellipse style dot notation? "..."

Hi all, I noticed this in Joe Hewitt's source for Three20 and I've never seen this particular syntax in Objective-C before. Not even sure how to reference it in an appropriate Google search. From TTTableViewDataSource: + (TTSectionedDataSource*)dataSourceWithObjects:(id)object,... { The "..." is what's throwing me off here. I'm assu...

Observing changes of derived properties: CALayer KVO example

Is there a way to observe changes in derived properties? For example, I want to know when a CALayer has been added as a sublayer so that I can adjust its geometry relative to its (new) parent. So, I have a subclassed CALayer, say CustomLayer, and I figured I could register an observer for the property in init: [self addObserver:self ...