Hi,
I have an NSTextView with text & images in it, which is supposed to send both in an e-mail.I know that the message.framework is deprecated,so I came up with the idea to send it via NSTask, since mail is integrated.I came up with the code below, however in the log I get this:
* -[NSCFDictionary setObject:forKey:]: attempt to inse...
I have a 1600x1600 1.2MB image which resized to 320x320 shrinks to 404KB.
I need to go further and reduce the bytes size without reducing the image aspect size.
Currently i'm using the -TIFFRepresentationUsingCompression:factor: NSImage method with NSTIFFCompressionJPEG and factor that doesn't seem to influence the image size/quality.
...
I have an NSDocument-based Cocoa app and I have a couple of secondary threads that I need to terminate gracefully (wait for them to run through the current loop) when the users closes the document window or when the application quits. I'm using canCloseDocumentWithDelegate to send a flag to the threads when the document is closing and th...
Hi
I'm interested in writing an applescript project that records the date on every keypress.
Can applescripts read this information while they're in the background? Or must they always be the selected window?
Where is a gool tutorial to start on something like this? I have programming experience, but not in Applescript or Objective-C
...
I'm making an app that includes the same group of buttons in many different contexts. The buttons send their actions to a different object in each context. I'd like to be able to design a single NSView in IB containing the buttons, and then be able to put copies of that view in many places in my nibs, while maintaining the link, so chang...
Hi,
How can i convert a Hexadecimal number to a nsuinteger
...
I have problem with BWToolkit and XCode. For some reasons Xcode not recognize bwtoolkit framework. IB plugin working fine. I did same steps as described on bwtoolkit site. I did:
Download latest bwtoolkit from http://www.brandonwalkin.com/bwtoolkit/
Add BWToolkitFramework.framework to Linked frameworks
Add BWToolkitFramework to copy ta...
Is there some blindingly obvious reason why this is producing a nil string instead of the actual text content of the file?
NSString *fromFile = [NSString stringWithContentsOfFile:
@"file://localhost/Users/username/Desktop/test.txt"];
NSLog(@"%@", fromFile);
PRINTS: "(null)"
The file is a plain ASCII text file ...
Seems like there wouldn't be, but it would help us out if there was. I wish to pull the source down to a windows server and compile it and have it be the same as if I had pulled the source code down to a mac machine and used xcode on it. Any Ideas?
Reasons: Release Engineering and IT are much more familiar and comfortable on windows, so...
I'm using the scripting bridge to query iTunes from my cocoa application. Sometimes iTunes pops up a window (like if an ipod needs updating etc.) and while that popup window is open I can't get any information from iTunes. So if I request information from iTunes when it's in this state my application completely locks-up until that popup ...
Hi,
My app requires an interface that has many buttons, text fields and matrixes. And they need to change from time to time. Right now I do this by having all elements in IB already and hiding/showing/moving them when needed. What would others recommend? Should I do that? Should I use an NSTabView? NSView? Should create the elements pro...
Hi,
I'm trying to create a cookie and it's not working. This is what I do:
NSDictionary *properties = [NSDictionary dictionaryWithObjectsAndKeys:
@".myurl.com", NSHTTPCookieOriginURL,
@"\\", NSHTTPCookiePath,
@"myCookieName", NSHTTPCookieName,
@"ABC", NSHTTPCookieValue,
nil];
NSHTTPCookie *cookie = [...
As docs say it's impossible to add two menu items to NSPopUpButton if they both have the same title. I was trying to add menu items to [popupButton menu], but with no luck. I was also trying to create a new menu, add items to it and then use [popupButton setMenu:newMenu], but no. Menu always display only one item per name.
But I know it...
Hello,
I would like to capture a string being pasted into a control and apply some custom formatting to the string before being pasted.
How is this possible?
Thanks!
...
Hi. I was parsing a XML feed and trying to convert it to a NSObject when I noticed that (e.g.) [NSDate dateFromString:@"Tue, 23 Feb 2010 06:00:44 PST"] returned nil. Then I tried to convert my string to a NSDate by using the NSDateFormatter.
NSDateFormatter *df = [[NSDateFormatter alloc] init];
[df setDateFormat:@"EEE, dd MMM YYYY HH:m...
I've been developing a Mac OS X framework and I want to use OCUnit in my XCode 3.2.1 project. I've followed several tutorials on how to configure a OCUnit test bundle. The problem is that when I create a test case that uses a function that is defined in one of the framework's sources, I get a building error telling me that the symbol is ...
Hello,
Always when I try to set an integer as Object in a NSDictionary the program crashes without a message (nothing in the console). What is wrong in this code? :
NSString *string = @"foo";
int number = 1;
NSDictionary *params = [NSDictionary dictionaryWithObjectsAndKeys:
string, @"bla1", number, @"bla2",nil...
Hi, my app needs to store latitude and longitude values parsed from XML into Core Data. Currently, I have a Core Data Model which has these attributes set to type double. The header file for the Model Object has them defined as NSNumber
How can I convert the string stored in my CurrentNodeText variable into the required type for stor...
Hello everyone,
I need to add this section into my application where the user would enter in a terminal command for example "killall SpringBoard" and when the user presses the button it would run the command. I know that if you use the System("") function you can run the terminal command. But how about from a textbox?
My next questio...
I have a distance as a float and I'm looking for a way to format it nicely for human readers. Ideally, I'd like it to change from m to km as it gets bigger, and to round the number nicely. Converting to miles would be a bonus. I'm sure many people have had a need for one of these and I'm hoping that there's some code floating around some...