cocoa

Automatic table column Indentifier in NSTableView

故事扮演 提交于 2020-01-13 06:01:04
问题 After bit of research, I was able to populate the NSTableView with some date via the "identifier way" like you assign unique identifier to each column. However, I would like to now if there is a way to populate NSTableView without providing the identifier to the columns and how? To be more clear - the use of automatic table column identifier, which is slightly described here: About the automatic table column identifier and and I find a way how to enumerate or get the index of the column by

how to make dashed line moveable

ⅰ亾dé卋堺 提交于 2020-01-13 05:10:50
问题 I used codes below to draw a dashed line // get the current CGContextRef for the view CGContextRef currentContext = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort]; // grab some useful view size numbers NSRect bounds = [self bounds]; float width = NSWidth( bounds ); float height = NSHeight( bounds ); float originX = NSMinX( bounds ); float originY = NSMinY( bounds ); float maxX = NSMaxX( bounds ); float maxY = NSMaxY( bounds ); float middleX = NSMidX( bounds ); float middleY =

NSDate and NSDateFormatter issues

与世无争的帅哥 提交于 2020-01-13 03:52:12
问题 I'm having slight difficulty in understanding why the following code is crashing an app of mine: NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setDateFormat:@"MMMM d, yyyy"]; NSDate *date = [dateFormatter dateFromString:cDate]; datePicker.date = date; NSString *dateStr = [dateFormatter stringFromDate:date]; [dateLabel setText:dateStr]; [dateFormatter release]; If I comment the above out, app is fine. Also if I change the date format to the following no crash

Round corners on a borderless NSWindow

大城市里の小女人 提交于 2020-01-13 03:41:51
问题 I'm creating an application and I don't want a title bar: If the title remains the same all the time, does it make sense to show it? For example, if an app doesn’t show the names of documents, or any other assets that it opens, and there is plenty of space at the top around other controls to grab onto if you want to move the window around, does the title serve much purpose? The problem is: how do I do this? I tried using [mainWindow setStyleMask:NSBorderlessWindowMask]; but I can't make it

Round corners on a borderless NSWindow

不想你离开。 提交于 2020-01-13 03:41:39
问题 I'm creating an application and I don't want a title bar: If the title remains the same all the time, does it make sense to show it? For example, if an app doesn’t show the names of documents, or any other assets that it opens, and there is plenty of space at the top around other controls to grab onto if you want to move the window around, does the title serve much purpose? The problem is: how do I do this? I tried using [mainWindow setStyleMask:NSBorderlessWindowMask]; but I can't make it

Addresponse - adding to memory only (XCode)

不问归期 提交于 2020-01-13 02:56:08
问题 I'm trying to connect my project to a php file but every time this shows: ADDRESPONSE - ADDING TO MEMORY ONLY I have never seen it before. this is the code i Use: //Gets the php FindURL = [NSString stringWithFormat:@"http://domain.com/Myfile.php?username=%@", Username.text]; // to execute php code URLData = [NSData dataWithContentsOfURL:[NSURL URLWithString:FindURL]]; // to receive the returend value DataResult = [[NSString alloc] initWithData:URLData encoding:NSUTF8StringEncoding]; NSLog(@"%

How to pass scroll events to parent NSScrollView

假装没事ソ 提交于 2020-01-12 16:50:47
问题 I need fixed-size NSTextViews inside a larger scrolling window. IB requires that the textviews be inside their own NSScrollViews, even though their min/max sizes are fixed so that they won’t actually scroll. When trackpad gestures are made within the textview frames (regardless of whether they have focus), they are captured by the textviews’ scrollviews, so nothing happens. How do I tell the textviews’ scrollviews to pass scroll events up to the window’s main scrollview? (Or perhaps I should

How to pass scroll events to parent NSScrollView

﹥>﹥吖頭↗ 提交于 2020-01-12 16:50:09
问题 I need fixed-size NSTextViews inside a larger scrolling window. IB requires that the textviews be inside their own NSScrollViews, even though their min/max sizes are fixed so that they won’t actually scroll. When trackpad gestures are made within the textview frames (regardless of whether they have focus), they are captured by the textviews’ scrollviews, so nothing happens. How do I tell the textviews’ scrollviews to pass scroll events up to the window’s main scrollview? (Or perhaps I should

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

霸气de小男生 提交于 2020-01-12 14:21:14
问题 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

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

一世执手 提交于 2020-01-12 14:20:13
问题 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