cocoa

iPhone Core Data relationship fault

Hi, I am building a core data iphone app, and having trouble with retrieving one-many relationship data. Please bear with me while I explain. I have used the data model designer to setup an entity called "Item" that contains many entities called "Comment". I then retrieve multiple entities and display them in a UITableView. I fetch the...

Fluent interface pattern in Objective-C

I am a newbie in Objective-c and I would like to implement fluent interface pattern in my OC class. Here is my updated and simplified case from my project: // .h file @interface MyLogger : NSObject { ... } - (MyLogger*) indent:(BOOL)indent; - (MyLogger*) debug:(NSString*)message, ...; - (id) warning:(NSString*)message, ...; .... @end...

Cocoa bindings between NSTableView and NSMutableArray refuse to update

Ok, I'm very new to Obj-C and Cocoa, but I'm sure my bindings here are correct. I've been googling, searching stack overflow and have checked my values again and again. So, here are my bindings: They connect to this class: @interface TMMaddMangaWindowDelegate : NSWindowController { ... } ... @property (copy) NSMutableArray* mangaLi...

NSScrollView doesn't show scrollbars even although the content is large enough

I have this class: Header: @interface vcMain : NSWindowController { IBOutlet NSView *scroll; } @property (retain) IBOutlet NSView *scroll; -(IBAction)test:(id)sender; @end Source: @implementation vcMain @synthesize scroll; -(IBAction)test:(id)sender { vItem *item = [[vItem alloc] initWithNibName:@"vItem" bundle:nil]; ...

Help with a method that returns a value by running another object's method

I have a Class that runs the following method (a getter): // the interface @interface MyClass : NSObject{ NSNumber *myFloatValue; } - (double)myFloatValue; - (void)setMyFloatValue:(float)floatInput; @end // the implementation @implementation - (MyClass *)init{ if (self = [super init]){ myFloatValue = [[NSNumber alloc]...

NSWindow is not displaying.

Hi, I am having a trouble try to display a NSWindow with out using Interface Builder. The initialization of the window was quite confusing since I am more familiar with iPhone (which does not have an NSWindow equivalent). So I searched Google for some code and I eventually found this: NSRect windowRect = NSMakeRect(10.0f, 10.0f, 800.0f...

Hide a ADBannerView. Is it ok to move it offscreen?

Hello, When the user changes screen, I want to hide the current ADBannerView . Is there a "right" way to do that? If I move it offscreen for instance, is it fine: I was wondering if it could keep serving ads while not being displayed and then I would break some Apple Agreement. Is it also OK to cover an Ad with a modal view? Thanks! ...

Displaying a programs output in Cocoa.

Hi, What view would be the best view for displaying text from the console? In particular output of a C program? For example if I used system("gcc foo.c"); in my program and then wanted to display the output of that what view would a I use and how would I display it? Also, how would I get input too? ...

NSScrollview may not respond to '-text'

I am having trouble assigning a NSString to the text of a NSScrollView. I have tried the following: NSString *medium = codeView.text; That didn't work so then I tried: NSString *medium = [codeView text]; This still doesn't work and it gives me the warning: NSScrollview may not respond to '-text' Or in the case of ...

CI Filter to create Black & White image?

I have a CIImage I need to convert from color to Black and White within my Cocoa / objective C program. Peter H. previously pointed me to this link (http://www.codingadventures.com/2008/06/threshold-filter-in-glsl/) as a potential solution ... but I am having trouble compiling the kernel routine there (see separate thread, if interested...

How to add 2 ViewControllers to the same window

I am following Stanford's iPhone Development course in iTunes U and I'm having problem with one of their assignments (Paparazzi, if anyone is familiar). What I'm trying to do is basically to create this view as the first 'screen' upon application launch: And this is the code that I have in the app delegate: - (BOOL)application:(UIAp...

isMemberOfClass vs comparing classes with ==

Is there any real difference between: id value; BOOL compare1 = [value isMemberOfClass:[SomeClass class]]; BOOL compare2 = [value class] == [SomeClass class]; to check if value is a SomeClass object? ...

CABasicAnimation's call to drawInContext causes instance variables to reset to zero

This might be my lack of understanding of the call stack when using Core Animation, but something confuses me a little about who/what is calling drawInContext. Lets say I have @interface PlayerLayer : CALayer { int Foo; } and I initialize Foo in init to be something like -(void) init { if( self = [super init] ) { Foo =...

iOS multiple image selection

Is it possible to write an app to behave like the photo picker does in the Photos app? Namely allowing users to select multiple images and greying out or putting a green tick on the selected ones? I've tried UIImagePickerController, but that appears to just dim the image when it's touched. ...

how to get the pid_t of the running dock.app in max os X

Hello, More or less everything is in teh title, I am looking for a way to get from a cocoa application, pid_t of the running dock.app Thanks in advance for your help, regard, ...

How does a NSMutableString exactly work?

I know all instances of NSString are inmutable. If you assign a new value to a string new memory is addressed and the old string will be lost. But if you use NSMutableString the string will always keep his same address in memory, no matter what you do. I wonder how this exactly works. With methods like replaceCharactersInRange I can e...

Incorrent NSTableView frame within an NSSplitView

Within my Mac app I've setup two NSSplitViews to create a Mail-style interface (with the first ScrollView used to create a vertical separator, and the second nested within the first, to create the horizontal separator). To illustrate the interface, I've created the following diagram: To illustrate the setup further, here's an annotate...

Sending large amounts of data with NSFileHandle

So I'm using Apple's PictureSharing/PictureSharingBrowser samples to send and receive data. This uses an NSFileHandle on the server side to send a picture using NSFileHandle's writeData method. NSFileHandle * incomingConnection = [[aNotification userInfo] objectForKey:NSFileHandleNotificationFileHandleItem]; [[aNotification object] acc...

Trouble converting NSNumber to int

Hi, Sorry about this silly question. I'm trying to learn objc and I'm unable to do a simple sum between 2 int values... In fact problem is before the sum. I have an object that have an instance variable defined as a NSNumber and it's defined as a property as follows: @interface MyObj : NSObject { NSNumber *count; } @property (readw...

How can I determine if a compiled Objective-C app is using garbage collection?

For any application that I have on my Mac, is there a way to tell if it was compiled with GC enabled, or if it's doing manual memory management? ...