cocoa

Thread 1: EXC_BREAKPOINT (code=EXC_i386_BPT, subcode=0x0) error

情到浓时终转凉″ 提交于 2020-01-12 14:20:08
问题 I have an iPad app I am making, but it crashes on startup even though there are no errors or warnings, the output doesn't output anything besides "(lldb)", and it marks a pointer. This is the image of the post build crash. And here is the code: - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { /* UIImage *myImage = [UIImage imageNamed:@"de_dust2.png"]; myImageView = [[UIImageView alloc] initWithImage:myImage]; myScrollView

NSImageView animations

折月煮酒 提交于 2020-01-12 10:13:23
问题 I am new to Mac development, Do we have any methods like imagev = [NSArray arrayWithObjects I need some thing like what we do in iOS want to do in mac, imageVie.animationImages = [NSArray arrayWithObjects: [UIImage imageNamed:@"1.png"],[UIImage imageNamed:@"2.png"], [UIImage imageNamed:@"3.png"],[UIImage imageNamed:@"4.png"], [UIImage imageNamed:@"5.png"],[UIImage imageNamed:@"6.png"], [UIImage imageNamed:@"7.png"] ,nil]; In iPhone, How can i animate Regards 回答1: I found someone using a Core

How to pass an arbitrary AppleScript Record to Cocoa in a scriptable app?

可紊 提交于 2020-01-12 08:28:11
问题 I have a Cocoa application with an AppleScript dictionary described in a .sdef XML file. All of the AppleScript classes, commands, etc. defined in the sdef are working property. Except for my "submit form" command. The "submit form" command is my only command attempting to pass a parameter that is an arbitrary hashtable of information from AppleScript to Cocoa. I assume this should be done by passing an AppleScript record which will be automatically converted to an NSDictionary on the Cocoa

List all drives/partitions, and get /dev/rdisc device with Cocoa

懵懂的女人 提交于 2020-01-12 08:00:10
问题 Is there a way to list available drives, similar to Disk Utility, and get the associated /dev/rdisk* device for it? Disk Utility has access to this data - when you select a drive and press the Info button, it lists.. Partition Map Scheme : GUID Partition Table Disk Identifier : disk0 Media Name : Hitachi HTS541612J9SA00 Media ..or select a partition: Disk Identifier : disk0s3 Mount Point : /Volumes/BOOTCAMP Is there a Cocoa API to get at this? If so, what is the best way to display this via

how to determine load application on iphone at first time?

喜你入骨 提交于 2020-01-12 04:06:41
问题 I wish the first time anyone loads my application to have it start at the preferences view i have and every other time to start at the main view. I could not find a way to detect if this is the first time the application is run. any ideas? - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch NSUserDefaults *padFactoids; int launchCount; padFactoids = [NSUserDefaults

how to determine load application on iphone at first time?

十年热恋 提交于 2020-01-12 04:06:18
问题 I wish the first time anyone loads my application to have it start at the preferences view i have and every other time to start at the main view. I could not find a way to detect if this is the first time the application is run. any ideas? - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch NSUserDefaults *padFactoids; int launchCount; padFactoids = [NSUserDefaults

“unrecognized selector sent to class” when calling category method from a library

那年仲夏 提交于 2020-01-12 03:32:06
问题 Problem This question may seem a bit long, but I try to give as much information as possible, since I am really staggered by this. I am currently working an a library which should automate XML document parsing. But I am running into a problem now testing the library for the first time. I have a library class called CSXDocumentLayout which represents the layout of a document. This class contains the private method - (NSError *)readLayoutDocument:(NSString *)fpath called from an init method. /*

Any way to ask a method for its name?

五迷三道 提交于 2020-01-12 03:16:39
问题 I'm trying to debug an iPhone app I'm working on, and the idea of adding fifty NSLog statements to the various source files gives me the willies. What I'd like to do is write a pair of statements, say NSString *methodName = [self methodName]; NSLog(@"%@", methodName); that I can just paste into each method I need to. Is there a way to do this? Is there some Objective-C construct for asking a method for its name? Or am I gonna have to do this the hard way? 回答1: Try NSLog(@"%s", __func__) .

Any way to ask a method for its name?

你离开我真会死。 提交于 2020-01-12 03:16:06
问题 I'm trying to debug an iPhone app I'm working on, and the idea of adding fifty NSLog statements to the various source files gives me the willies. What I'd like to do is write a pair of statements, say NSString *methodName = [self methodName]; NSLog(@"%@", methodName); that I can just paste into each method I need to. Is there a way to do this? Is there some Objective-C construct for asking a method for its name? Or am I gonna have to do this the hard way? 回答1: Try NSLog(@"%s", __func__) .

Error “Library not loaded” when launching app

你离开我真会死。 提交于 2020-01-12 02:27:31
问题 I have created a Mac app which uses the RMSharedPreferences framework. When opening the app, it immediately crashes and I get the following error: Dyld Error Message: Library not loaded: @rpath/RMSharedPreferences.framework/Versions/A/RMSharedPreferences Referenced from: /Users/USER/Desktop/MyApp.app/Contents/MacOS/MyApp Reason: image not found It seems that it can't find the framework. I have tried adding a copy files phase to the target which should copy the framework and when browsing the