Все вопросы: [cocoa]

2 549 вопросов

1
голосов
1ответов
410 просмотров

Cocoa-Touch. What Exactly is the Difference Between These NSMutableData Methods?

One thing I'm a bit unclear on is the difference between these NSMutableArray Methods: // Class Method Style NSMutableData *myMutableDataInstance = [NSMutableData dataWithLength:WholeLottaData]; and // Instance Method Style NSMutableData *myMutableDataInstance = nil; myMutableDataInstance...

1
голосов
3ответов
2614 просмотров

NSAutorelease memory leak

I am getting this error message in the console: *** _NSAutoreleaseNoPool(): Object 0x10d2e0 of class NSPathStore2 autoreleased with no pool in place - just leaking I can't figure out what is the error? Thanks.

0
голосов
1ответов
785 просмотров

How to develop a safari plugin(input managers) use SIMBL?

Now I want to develop a safari plugin use SIMBL , but I searched a lot of webpage not found some sourcecode or simple sample , someone can give me or point to a location ? Thank you very much!!!

4
голосов
1ответов
321 просмотров

How do I delete an entity when removing it from an array controller?

I have an entity (e.g. Employee) in a managed object model that is related to two other entities (e.g. Department and Team). Both relationships are one-to-many (i.e. an Employee must have one Department and one Team, Teams and Departments have many Employees). The two may or may not overlap (e.g....

10
голосов
6ответов
24489 просмотров

Why is my transformable Core Data attribute not using my custom NSValueTransformer?

I have a Core Data app with a fairly simple data model. I want to be able to store instances of NSImage in the persistent store as PNG Bitmap NSData objects, to save space. To this end, I wrote a simple NSValueTransformer to convert an NSImage to NSData in PNG bitmap format. I am registering the...

-1
голосов
3ответов
299 просмотров

When use clicktoflash, how to show other flashs in a webview based on Safari?

Now I develop a program with a webview showing flash. but I found that when I installed clickToFlash , the webview not to show the flash. I think that when webview load , the safari will check the MIMETYPE , and clickToFlash's MIMETYPE will first chek by safari , so the clicktoflash will handle m...

7
голосов
1ответов
2050 просмотров

NSCollectionView draws nothing

I'm trying to set up an NSCollectionView (I have done this successfully in the past, but for some reason it fails this time). I have a model class called "TestModel", and it has an NSString property that just returns a string (just for testing purposes right now). I then have an NSMutableArray p...

2
голосов
3ответов
330 просмотров

Why is my value passed through NSNotifcationCenter not preserved?

I'm trying to send a CGPoint through an NSNotification like this -(void)setPosition:(CGPoint)point { NSString *pointString = NSStringFromCGPoint(point); NSDictionary *dict = [[NSDictionary alloc] initWithObjectsAndKeys:@"p", pointString, nil]; [[NSNotificationCent...

4
голосов
3ответов
2973 просмотров

How can I set rich text properties on a UITableView footer?

I am using - (NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section { if ( section == 0 ) { return NSLocalizedString(@"Section_0_text", @""); } if ( section == 1 ) { return NSLocalizedString(@"Section_1_text",""); } return nil; } Can I...

5
голосов
4ответов
3029 просмотров

How can you tell if a directory is writeable in Objective-C?

I want to use an open panel to let the user select a destination, but I want to alert them at that point that point that the directory is not-writable. I generally prefer to create it and handle the error, but that's not useful to me here, since I don't want to create the folder just yet. (I'll b...

1
голосов
4ответов
2079 просмотров

CGEventTimestamp to NSDate

I'm simply trying to convert a CGEventTimestamp (which is an unsigned 64-bit integer roughly representing nanoseconds since system startup) into an NSDate. I know there's a way to convert "time since system startup" into either an NSTimeInterval or a date relative to a reference date, but I'm not...

6
голосов
5ответов
5505 просмотров

Cocoa: Problem passing a CGPoint with NSNotification and NSDictionary

I'm trying to fire a Notification in a method called setPosition in one class, that triggers setViewPointCenter in another class. However, I'm trying to send a CGPoint along with it. But Xcode isn't liking it one bit. -(void)setPosition:(CGPoint)point { NSDictionary *dict = [[NSDictionar...

5
голосов
2ответов
3170 просмотров

Need help understanding "kCGErrorIllegalArgument: CGSUnionRegionWithRect : Invalid Region"

While running my application (which does a good bit of custom drawing) I get this error (it happens a good bit with no observable side effects, but I'd like to understand what's happening). <Error>: kCGErrorIllegalArgument: CGSUnionRegionWithRect : Invalid region <Error>: kCGErrorFai...

-2
голосов
1ответов
490 просмотров

autorelease pool causes crash in RubyCocoa application

I'm having crash in my application, which says trying to pop an unknown autorelease pool: 10/19/09 11:40:11 AM MyApp[89480] *** attempt to pop an unknown autorelease pool (0x11bc800) How to trace it down? Since it's RubyCocoa application it's almost impossible to trace it with gdb in Xcode env...

4
голосов
3ответов
1840 просмотров

How to identify & use OSType in Cocoa

In Cocoa/Mac OSX 10.6 OSType IOSurfaceGetPixelFormat(IOSurfaceRef buffer) returns a type OSType where can I find some documentation/reference on the supported OSType with regard to the context of this function. What sort OSType should I expect with IOSurfaceGetPixelFormat? do you have any i...

2
голосов
1ответов
1239 просмотров

NSDictionaryController doesn't seem to observe changes to content dictionary

I must be missing something simple, but I am having some trouble binding a tableView to an NSDictionaryController. Here is a model of my current scheme: TableViewColumn --bindsTo-->DictionaryController.arrangedObjects.(value or key) --bindsTo-->someClass.someClassMember.aDi...

0
голосов
2ответов
335 просмотров

Cocoa Java compilation failure in XCode 3.2

I developed an application in using Cocoa using Xcode 3.1. Now I upgraded the OS version and tried to compile the code in Xcode 3.2, but the app crashes with an error: CocoaJava: com.apple.cocoa.foundation.NSRuntime -[NSJavaVirtualMachine initWithClassPath:] FATAL: cannot initialize ObjCJav...

0
голосов
2ответов
723 просмотров

Trying to copy a string into a textfield in objective-C

I am having trouble copying the value of an NSString into a Textfield value. I've done this before, but for some reason it's not working in the function below. Can someone tell me if I'm doing something wrong? pictureComment is the Textfield and comment is an NSString. When I look at the log fi...

2
голосов
1ответов
1502 просмотров

Cocoa - Add Video Watermark General Info

Just looking for how to programmatically add a watermark or some sort of overlay to video using cocoa. Not looking for a step by step ( although that would awesome ), but more or less looking for where I should start looking to learn how. Are there frameworks developed to work for this. Would ...

0
голосов
1ответов
108 просмотров

How do I find out why file I/O operations fail?

Several methods I've used to write to files return a BOOL signifying their success, e.g. NSDictionary: - (BOOL) writeToFile:(NSString *)path atomically:(BOOL)flag NSKeyedArchiver: - (BOOL) archiveRootObject:(id)rootObject toFile:(NSString *)path Somehow, this returned NO on one of my teste...

1
голосов
4ответов
696 просмотров

How to extract pure string from a constant string

When I print the value of a CFString constant e.g. an AddressBook label in the console, the output value is _$!<home>!$_. How do I extract only the pure value, e.g home? ANy help would be greatly appreciated please.

0
голосов
1ответов
556 просмотров

NSStatusBar animating text

I'm trying to animated text in the NSStatusBar similar to how the text "Dialing ..." scroll from right to left when dialing-up to Internet. I'm not sure how to do this so is there some code example or guide on how to go about this?

1
голосов
4ответов
810 просмотров

How do I prevent a WebView from scaling down a rendered web page?

I'm developing a Cocoa/Obj-C application that involves a WebView (from the WebKit framework). I've noticed that this WebView presents a slightly scaled-down version of the rendered webpage. An example screenshot: In a browser (Safari or Firefox): alt text http://img132.imageshack.us/img132/9824...

0
голосов
3ответов
423 просмотров

Quick Multiplication Question - Cocoa

I'm still learning, and I'm just stuck. I want the user to enter any number and in result, my program will do this equation: x = 5*y (y is the number the user adds, x is outcome) How would I do this? I'm not sure if I'm suppose to add in an int or NSString. Which should I use, and should I en...

2
голосов
3ответов
2457 просмотров

How should I construct an NSDictionary with multiple keys?

I have a situation where I want to map a pair of objects to a dictionary of information. I'd like to avoid creating an NSDictionary of NSDictionaries of NSDictionaries since that's simply confusing and difficult to maintain. For instance if I have two classes, Foo and Bar, I want {Foo, Bar} -&g...

6
голосов
2ответов
937 просмотров

Setting up relationships while importing core data?

I have an in memory managed object context called importMoc that I use to import records (e.g. employees). I have parsed a file and set up the employee objects in importMoc with one very important exception. The user confirms they want to process %d employees but I can't quite figure out how or w...

0
голосов
4ответов
2939 просмотров

Cocoa API Image Manipulation

Is there any way to do simple image manipulation like adjusting brightness, contrast, exposure, etc. using Cocoa? Something like NSImage?

1
голосов
1ответов
310 просмотров

A good way to create a shortcut selection field for use in a Mac app?

I need to have a way for the user to input a shortcut key combination in my Preferences and I'm looking to do something that works similar to how the System Preferences keyboard shortcut panel works. I thought about subclassing an NSTextField and override keyDown: and keyUp: but it seems these ...

2
голосов
2ответов
1190 просмотров

Cocoa-Bindings : Update NSObjectController manually?

In my little cocoa application I have bound the properties of a class to some text fields with help of a NSObjectController. The only problem I have so far: you always have to leave a text field before the NSObjectController updates the class with the current input. This becomes a problem if the...

2
голосов
6ответов
4376 просмотров

Finding duplicates in an NSMutableArray

I have a class (colorClass) which holds 2 NSStrings (idNumber and favoriteColor). There is an NSMutableArray (arrayColor) that holds over 50,000 colorClass objects. What is the fastest way to find all duplicate idNumbers from all colorClass objects and return them in an array? Right now I'm us...