objective-c

What's required to implement root class of Objective-C?

I tried this code: // main.m #import <stdio.h> @interface Test + (void)test; @end @implementation Test + (void)test { printf("test"); } @end int main() { [Test test]; return 0; } with LLVM/Clang without any framework, it doesn't compiled with this error: Undefined symbols: "_objc_msgSend", referenced from: _ma...

Draw ECG graph dynamically in iphone ?

HI All, Is there any way to draw a 2d graph of ECG (in wave form) in iphone .I am getting a large anount of data in couple of seconds i mean the gap will be of just 1 Secs.then is there any way to draw the graph in iphone or any library (IN c or c++) by which i can use it and it draw a live graph of any heart beat analysis and looks al...

Return type of [self class]

Is it possible to set the return type of a selector in objective-c to be the class itself? For example, is it possible to do something like: + ([self class] *) selectorName; So that given a super class such as: @interface MyClass : NSObject {} + (MyClass *) instanceOfMyClass; @end @implementation MyClass + (MyClass *) instanceOfMy...

How do I create Json requests in Objective C

I have a great framework however I cannot figure out how to create requests. All the tutorials assume you are simply downloading and parsing Json data - but I need to build a Json request send it off and then parse the response. Anyone have ideas and in particular sample code which builds up the request. ...

Problem with AVAudioplayer or delegate getting dallocated prematurely

Hi! I am making a counting game for kids. At the start the child is asked find a number of items, for example: "Can you find five bikes". This is all randomly put together from seperate arrays of sounds with parts of the sentence: "Can you find" + "5" + "bikes" =three seperate mp3s. When the child starts clicking on the items, they disa...

iPhone _NSAutoreleaseNoPool() problem

Hi I have this in my main.m: printf("make autorelease pool \n"); NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; int retVal = UIApplicationMain(argc, argv, @"UIApplication", @"MyAppDelegate"); [pool release]; return retVal; And i suddenly started to get this when I run my app on the simulator: 2010-08-27 11:09:35.909 My...

In Objective-C, best way to extract substrings from NSDate?

I am currently extacting yyyy mm dd hh mm and ss from NSDate like this:- NSDate* dd = [NSDate date]; NSString* date = [dd description]; NSString* y = [date substringToIndex:4]; NSString* m = [[date substringFromIndex:5] substringToIndex:2]; NSString* d = [[date substringFromIndex:8] substringToIndex:2]; NSString* h = [[date substringF...

Can i sort the NSDictionary on basis of key in Objective-C?

Hello, Can i sort the NSDictionary on basic of key ? Thank You. ...

how can i set attributes of NSFontPanel?

how can i set attributes of NSFontPanel, like color, bold etc ? ...

set Orientation of Image in UITableView iPhone?

Hi to all I'm having Application based on quiz. it is collection of questionnaires, images. its xml based database and i accessed its only one class that is Uitableview in one tableview through access upto 56 questions and 25 images. Actually i want to run app on both modes that first one is landscape and another one is portrait. My pro...

How to access dropped files in a droplet style cocoa application

Pretty much all the apps I use on a regular basis implement this 'seemly simple' scenario, yet I can't replicate this in my own Cocoa application. Please consider these steps: The application is not running You drop a file, or a selection of files onto the app's icon. The app runs and performs some actions on the dropped files. Maybe i...

how to check "Entered date is past date"

Hello All, I need to check whether an entered date [ taking input from user in textfield] is past date or not. Thanks, Sagar ...

How to set an image on another view on dismissing current view in iphone??

How to set an image on another view on dismissing current view in iphone?? ...

how to change value of NSColor object into its 8 bit value

I need to convert Value of NSColor object into 8 bit integer value code : uint8_t r = (uint32_t)(MIN(1.0f, MAX(0.0f, [[CWhiteBoardController ReturnFillColor] redComponent])) * 0xff); uint8_t g = (uint32_t)(MIN(1.0f, MAX(0.0f, [[CWhiteBoardController ReturnFillColor] greenComponent])) * 0xff); uint8_t b = (uint32_t)(MIN(1.0f, MAX(0.0f...

UIAlertViews disappear when calling UIActivityIndicatorView method

Hi, if I show an Alert and then call a method of an Activity Indicator, the alert disappears like the user has pressed OK. Declaration of alert: UIAlertView *errorAlert = [[UIAlertView alloc] initWithTitle:@"Error loading content" message:errorString delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil]; [errorAlert show]; [err...

Objective C wheel menu for iPhone

Hi, I want to create a rotating wheel menu which the user can use his/her finger to rotate the menu. I understand how to rotate the circle but I have no idea how to rotate it when the user drags it using his/her finger in the right direction that hte user is dragging the wheel in. Any help please? Thank you! ...

Loading navigation controllers after another view...

Hi all, I am trying to load a navigation controller after a home page, so on the home page I have an action that is triggered when a icon is clicked: - (IBAction)showContact:(id)sender { ContactViewController *Contactcontroller = [[[ContactViewController alloc] initWithNibName:@"ContactView" bundle:nil] autorelease]; Contactco...

Better illustrating error message for NSXMLParser

Hi, Now the user only get a error message like "Error code 5". NSString *errorString = [NSString stringWithFormat:@"Error code %i", [parseError code]]; UIAlertView *errorAlert = [[UIAlertView alloc] initWithTitle:@"Error loading content" message:errorString delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil]; [errorAlert show...

newbie question on updating color on UIView

I am using a UIView object that simply sets the background color to blue. This works fine the first time the code runs, but running the changeBackgroundColor mehod again (from a button action) doesnt change the color to red, even though debugging the code clearly shows the method runs as expected. Please could someone explain why the v...

Is "removeAllObjects" supposed to release?

I decided to start using removeAllObjects so that I could re-use some of my NSMutableArrays. However, I am finding that the call to removeAllObjects causes the array to get released and so it crashes when the viewController is displayed for the second time. I've looked on the web and it seems that some people are saying that removeAllOb...