cocoa

problem while accesing mutable array value

Hi I am new to this objective c I have created the one mutable array in appdelegate. I am trying to retrieve values of that mutable array in another app. But it is crashing at that point. below is the code i have declared in appdelegate savedLocation = [[NSMutableArray alloc] init]; savedLocation = [[NSMutableArray arrayWithObjects:...

Cocoa binding with @sum value of child

I'm trying to have a table column to display the sum of child values using the IB. I'm not sure if this is doable though. So I have my Core Data bind to a table and a column of "total sales amount" that should be a total of the sales of the parent object. I'm trying to do it like this: "[email protected][email protected]...

Does @property(retain) need a release?

Below are three fragments of code, the first two are interfaces for two objects along with a couple of @property commands. Please note that this is just me learning, its not part of an application just a small test program. After adding (retain) to the 2nd @property I noticed that my machine object was leaking when my program exited, w...

Objective-C / Cocoa creation release order?

I am just curious if the order expressed for the release of objects should reflect the reverse of their order in the hierarchy: // Psuedo code alloc OBJ_001; alloc OBJ_001 > OBJ_002; alloc OBJ_001 > OBJ_002 > NSSting; release NSString; release OBJ_002; release OBJ_001; I am pretty sure it should (makes sense to me), but have not seen...

Differences between NSStrings?

I understand that the v03 example creates an object that I own and must ultimately release. What I would like to know is are there any differences between the first two(v_01 & v02), or are they essentially the same? // Version_01 userName = @"Teddy"; // Version_02 userName = [NSString stringWithString:@"Gary"]; // Version_03 userName ...

Should you still do memory management in a unit test? (OCUnit)

Hi! Should I still bother with releasing objects in a unit test? I noticed in Apple's "iPhoneUnitTests" sample project objects are [[object alloc] init] in the setup method but never released anywhere in the unit test? Thanks! ...

cocoa + dmg file + trace back its path

Hi guys I have a situation in which my .dmg file will on my removable storage device which contains my application. when i double click on it, it will get mounted on my local machine and inside the mounted volume will be my .app (aplication file). Now I want my application to auto launch once my dmg file is mounted on my local machine. ...

Real-time audio visualisation in Cocoa?

Are there any frameworks or open-source code that would simplify the process of implementing a real-time oscilloscope (time-domain audio visualisation) in OSX? Ideally, I want to display a simple animated view representing the audio signal being input by the microphone input. ...

Are instance variables set to nil by default in Objective-C?

Hi there, I'm sorting out some memory issues with my iPhone app and I've just been thinking about some basics. If I setup an ivar and never end up using it in the lifespan of my object, when I call dealloc on it, will that cause a problem? E.g. @interface testClass { id myobject; } @property (nonatomic, retain) id myobject; @end @...

WebView Cocoa control crashing on window close.

I get a crash in WebEditorClient::clearUndoRedoOperations which is trying to access -[WebView(WebViewEditing) undoManager] when I close the main window of an NSDocument that contains a webview with a text editor in it. It only happens when there is an undo-able state. Seems like a bug in Cocoa, but I might be doing something wrong. Any i...

client side application not working as intended while using AsyncSocket

Hi All, I am using AsyncSocket class in a simple client-server application. As a first step I want that - as soon as connection is established between client and server, client transmit a welcome message - "connected to xyz server" to server and server displays it in textview. //The code in ClientController class is: -(void)awakeFrom...

Only first frame renders with OpenGL in Cocoa

I've been banging my head against a wall for a few days with this. I've read every document I could find and more on the subject of OpenGL and Cocoa. I'm just not understanding where my attempts break and the other ones don't. My code is listed below, it is fairly short as all I'm trying to do is render a rotating triangle. I am not new...

Interface Builder doesnt show some of my resource images

I have almost 20 images in PNG format added to my current project on Xcode (under the proper group, Resources). Unfortunately, library window's Media tab doesnt show some of them. And if I create an UIImageView and set one of these invisible images from code, nothing shows up. I also tried from IB with adding a UIImageView and set its so...

AppDelegate Being accessed from different classes, from RootController.m

Hi All, My problem is in getting the information from a controller(which happens to be my rootViewController) to another view. In trying to get access to it through the app delegate, I was not able to get it working. I have found how to do this, but this inturn created another problem of getting the view inside a modal view controller t...

How to create a Coda plug-in which creates a new site?

Hi, I'm using Coda for web developement. I often create new sites in my ~/Sites folder. I always enter the same information in Coda, except for the name of the site, and the directory where it's stored. Is it possible to create a plug-in (in either Cocoa or ShellScript) which automates this (so I don't need to enter all FTP stuff etc......

display something on the screen everytime action made

hi everyone I have a problem not sure how to solve this. Hmm I am developing a game, a multi touch game, I already can make everything working fine, except a small issue that I want to show messages on the playing screen, each time the player makes actions. like his finger moves right the message says : "this finger moving right" nicely...

How to create a Firefox add-on using Objective-C on Mac OS X?

More precisely my goal is to create an add-on (or plug-in?) which is able to communicate with my main Cocoa application using something like the NSDistributedNotificationCenter. I need to be able to inject JavaScript code into the current webpage and get return values from the JS calls when my add-on receives the request to do so by my m...

Appending to NSString (immutable)?

Just trying a few things out and noticed that this works, it does compile, but I just wanted to check if it would be considered good practice or something to be avoided? NSString *fileName = @"image"; fileName = [fileName stringByAppendingString:@".png"]; NSLog(@"TEST : %@", fileName); OUTPUT: TEST : image.png Might be better writt...

Can Cocoa be used in FileMaker Plugins?

I am trying to port a Windows FileMaker plugin to OS X and am thinking that I should be doing this in Cocoa not Carbon, but I am struggling to get anything to compile as soon as I include Cocoa.h ...

How to get file path of a CalCalendarItem?

Hi guys, I want to add meta data to an iCal event (task) with OpenMeta. Therefor I need the path to the file that contains the event (task). Is there a possibility to get this programmatically if a have a certain CalCalenderItem? Thank you very much! Best, Felix ...