objective-c

json-framework: EXC_BAD_ACCESS on stringWithObject

UPDATE: I found that the reason for the previous error was an error in the documentation. The method should be named proxyForJson, not jsonProxyObject... But I'm still stuck, though. I now get an EXC_BAD_ACCESS error inside stringWithObject some where. Any clues? UPDATE 2: My proxyForJson implementation is a cut-n-paste from th...

How to setup Xcodes "debug/release target settings"?

Hi I have found a set of great macros here Objective C Macros I put the: #if DEBUG==1 #define .... macros in my header file. Now I simply can't figure out where to set DEBUG=1 or DEBUG=0 in Xcode so that it will define the macro when debugging and not when releasing. Hope someone can help me find the missing drop down menu:) Thank...

Question about factory method object lifetimes in Objective-C/Cocoa (to retain or not...)

From reading the memory management docs in the SDK, I gathered that factory methods (static constructor methods) would typically be retaining the object for me and adding it to the autorelease pool? This would mean I have no need to retain & release an object as long as the pool does not get released before I expect? (Which should be at...

Objective C Path drawing to link buttons

Hi all, Does anyone have any idea on how to make a path drawing to "link" up two buttons like the iphone game Airline Conqueror? ...

request for member 'title' not a structure or union??

#import "RootViewController.h" #import "DetailViewController.h" @implementation RootViewController - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { // UITableViewStyleGrouped table view style will cause the table have a textured background // and each section wi...

Releasing Managed Objects in Objective-C

Okay, PLEASE bear with my description of my situation: I have a Core Data model that (in a simplified description) includes a GridManager object. The GridManager holds a set of Grid objects (via a to-many relationship). The Grid object contains a set of Cell objects (via a to-many relationship). In my app, I have a GridView that cont...

why is this sin method returning a wrong answer?

Hey, working on some categories and I've bumped up against a weird issue, im basically expanding on a calculator class to add some trig methods, and i am getting an incorrect value when i call the sin method in the return in the form of a double. i send a value of 100.7 to the method and it returns 0.168231, from what i can see the corre...

Hide NSWindow title bar

Is there a way to hide the titlebar in an NSWindow? I don't want to have to completely write a new custom window. I can't use NSBorderlessWindowMask because I have a bottom bar on my window, and using NSBorderlessWindowMask makes that disappear. I also tried using setContentBorderThickness:forEdge: with NSMaxYEdge and setting it to 0, th...

How do I create an MD5 Hash of a string in Cocoa?

I know SHA-1 is preferred, but this project requires I use MD5. #include <openssl/md5.h> - (NSString*) MD5Hasher: (NSString*) query { NSData* hashed = [query dataUsingEncoding:NSUTF8StringEncoding]; unsigned char *digest = MD5([hashed bytes], [hashed length], NULL); NSString *final = [NSString stringWithUTF8String: (char *)...

How to convert NSString of Decimal to NSString of Bytes

I have a very big integer value in decimal which i put in NSString , i need to convert to NSString of Bytes value for this big value how can i do it? FYI the length of NSSting is "308" Please help Thanks ...

Objective C syntax and compile warnning

Hi, top coders when I compile my app project via xCode , I got too many warning, most say : 'myClass' may not respond to '+isAliveNetworkConnection:' , although the method 'isAliveNetworkConnection' was implemented in the .m file but it does not declare in .h file , I find it works so I do not like to rewrite in the head file again; ...

iphone @property

What is the difference between these two? @property (nonatomic, retain) @property (nonatomic, copy) What is the other type like this? ...

NSInteger and decodeInteger:forKey: Problems.

I have the following two archiving methods: - (void) encodeWithCoder: (NSCoder *) encoder { [encoder encodeObject:self.exercises forKey:@"exercises"]; [encoder encodeObject:self.title forKey:@"title"]; [encoder encodeObject:self.description forKey:@"description"]; [encoder encodeInteger:self.idnum forKey:@"idnum"]; ...

how to add the new cell in table view from app in objective-c

how to add the new cell in tableview after running the program. that mean from the app i want to add the new cell for new entity like adding the new contact name in table view. ...

Clang static analyzer gives warning over autoreleased

result = [result stringByReplacingOccurrencesOfString:@"ç" withString:@"c"]; result = [result stringByReplacingOccurrencesOfString:@"Ç" withString:@"c"]; clang Static analyzer gives warning "Method returns an Objective-C object with a +0 retain count (non-owning reference)" return [result autorelease]; " Object over-autoreleased: o...

TTThumbView + NavigationBar

Hi, I use an application with an UINavigationBar, in a part of my application I click on a button to use the the TTThumbViewController (MockPhotoSource), the problem is when I click back on the NavigationBar it seems to add the property of three20 navigationBar to my original NavigationBar. How can I disable the three20 NavigationBar w...

NSTextField value during edit is the field editors value. But I need the field's original value

When I send stringValue to a NSTextField when it's field editor is active, it returns the current value from the field editor. But I need the original value from the NSTextField before it started editing! How can I get it? (tried to get the stringValue from the NSTextFieldCell, but I get the field editors value too) Any suggestions how ...

URL GET/POST Request objective-c

Hello! I have to send get or post request to localhost: <?php if(@$_GET['option']) { echo "You said \"{$_GET['option']}\""; }else if(@$_POST['option']) { echo "You said \"{$_POST['option']}\""; } ?> ive using this code: NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://localhost/wsh/index.php?o...

How to get serial number from hard disks? "Mac"

Is there any easy way to get the serial number of all the hard disks in a Mac using any API's? Basically looking for a unique identifier for hard disk, with which I should make out that the Hard disk has been used(referred) by my application or not. Please let me know if there is any other solution. Note: I need this solution in 10.4 a...

Beginners guide to 3D programming in IPhone SDK

I'm thinking of starting a project to make a game, maybe just a simple one, but still a game in 3D for the IPhone. Though i still have a long way to go, learning objective-C and so on, but a question popped in to my mind while thinking of the 3D gaming world. Would i benefit from learning OpenGL(PC/Mac) first before doing games for the...