|
Is point a Superclass* with the child method only declared on a subclass? Because you need to cast down to the subclass to make that type-check.
|
# ? Jun 21, 2011 00:50 |
|
|
# ? May 16, 2024 18:38 |
|
I'm trying to learn Cocoa by creating a simple subclass of NSTableView, called LayoutView. I've added it to my .nib via the CustomView placeholder in Xcode4's gui builder, and I've set the name of the class to LayoutView. I've added the method awakeFromNib, and in it, I have the following code: code:
What am I missing? I haven't hooked LayoutView up to a data source yet. Is this necessary for the table to display at all, or am I missing something else? Eponym fucked around with this message at 05:11 on Jun 21, 2011 |
# ? Jun 21, 2011 04:06 |
|
Eponym posted:I'm trying to learn Cocoa by creating a simple subclass of NSTableView, called LayoutView. You might have better luck if you add an actual NSTableView to the nib, and set it's class to LayoutView. Why are you subclassing NSTableView? You generally shouldn't do that without good reason. The setup code you have there would be more properly placed in a controller class (say, the NSWindowController subclass you use for the window your table view is in). Also, you're leaking the table column. Read up on memory management (though maybe if you're using ARC now, that's okay because it's handled for you? gently caress me if I know).
|
# ? Jun 21, 2011 06:41 |
|
Choadmaster posted:You might have better luck if you add an actual NSTableView to the nib, and set it's class to LayoutView. I planned to create a view controller to handle the setup later; I was just trying to find the quickest way to visualize what I want. I'm using garbage collection by setting the "Objective-C Garbage Collection" in the project settings to "required". I thought that was enough to not have to worry about retain/release. I subclassed because I wanted to be able to draw a curve that spans across multiple columns of the TableView. Ideally, I'd like to be able to composite whatever the NSTableView draws with a view of the same size, containing some random bezier curve. I'm not clear on how exactly to get there, but I thought subclassing NSTableView was a logical first step. If any of these reasons/methods sound like crap, sorry in advance. Eponym fucked around with this message at 08:21 on Jun 21, 2011 |
# ? Jun 21, 2011 08:14 |
|
Eponym posted:I'm trying to learn Cocoa by creating a simple subclass of NSTableView, called LayoutView. Check out the Table View Programming Guide.
|
# ? Jun 21, 2011 08:52 |
|
I've inherited an iPhone app and I've got maybe 12 hours of experience in Xcode 4 and Objective C so I'm kind of stuck slamming my head against a wall for some issues I've encountered. The biggest problem I'm having is figuring out the best way to display the contents of an RSS or XML feed in a nice dynamic layout and have each item be clickable. I've found some example code online but half of them don't compile for whatever reason and there doesn't seem to be any quick any easy way to parse XML in Objective C. If anyone can point me in the right direction it'd be much appreciated. As a rundown of what I'm trying to do:
|
# ? Jun 21, 2011 15:52 |
|
Yodzilla posted:I've inherited an iPhone app and I've got maybe 12 hours of experience in Xcode 4 and Objective C so I'm kind of stuck slamming my head against a wall for some issues I've encountered. The biggest problem I'm having is figuring out the best way to display the contents of an RSS or XML feed in a nice dynamic layout and have each item be clickable. I've found some example code online but half of them don't compile for whatever reason and there doesn't seem to be any quick any easy way to parse XML in Objective C. If anyone can point me in the right direction it'd be much appreciated. As a rundown of what I'm trying to do: I use (and recommend) ASIHTTP for grabbing web stuff, and hpple for parsing (because you get XPath). But Google's objective-c XML parser is also great. For your requirements it sounds like a Table View is a natural fit. Also Ray has a tutorial related to your situation.
|
# ? Jun 21, 2011 16:34 |
|
Sweet, thanks for those resources. I'll take a gander tonight when I get back to my development environment.
|
# ? Jun 21, 2011 16:45 |
|
rjmccall posted:Is point a Superclass* with the child method only declared on a subclass? Because you need to cast down to the subclass to make that type-check. I'm using Cocos2D, and I just found out it's apparently unavoidable, unless you edit the extensions in some way. Quoted from another forum, if this makes any sense "Cocos2d defines CGPointObject in CCParallaxNode.m, and although we're extending that class there's no handy way to let the compiler know about CGPointObject in our file."
|
# ? Jun 21, 2011 17:07 |
|
You can still make a declaration for it with a category, but if the @interface and method are private to some implementation file then you're almost certainly not supposed to be accessing it.
|
# ? Jun 21, 2011 17:41 |
|
I'm learning Xcode/Obj-C by writing an iOS app and I've got what I think is a pretty easy question. I've got a eleven-digit number (e.g., 12345678901) that I want to format as a phone number (e.g., 1 (234) 567-8901). How do I do that? e: it's a number in a plist, not necessarily an NSNumber. Sorry. stray fucked around with this message at 00:20 on Jun 22, 2011 |
# ? Jun 21, 2011 17:57 |
|
There's a pretty cool blog post about how to format phone numbers and that are local aware here: http://the-lost-beauty.blogspot.com/2010/01/locale-sensitive-phone-number.html Parentheses and dashes are not allowed in NSNumberFormatter, so I don't think that would help you. LP0 ON FIRE fucked around with this message at 18:38 on Jun 21, 2011 |
# ? Jun 21, 2011 18:31 |
|
ModeSix posted:I have a question about scheduling updates. Anyone? I'm using cocos2d if that helps clarify the question.
|
# ? Jun 21, 2011 18:46 |
|
ModeSix posted:Anyone? It's been a long time since I've done any game code, but it seems like it would be less messy to have a single schedule/timer handle it. Have it do "ticks" (for example every 0.1 second or whatever granularity you need) and keep a record of the last event that happened (for each event saving the "gametime" + the object spawned at that time). Then each tick, check the previous event(s), and see if there's any new actions to take, such as putting another object on the screen, what have you.
|
# ? Jun 21, 2011 19:25 |
|
NOG posted:There's a pretty cool blog post about how to format phone numbers and that are local aware here: http://the-lost-beauty.blogspot.com/2010/01/locale-sensitive-phone-number.html I know there's something obvious I'm missing, here, but I can't even seem to get it to display right without the nice formatting. In trying to convert the number to a string, it's doing one of those horribly annoying format-conversion things. I thought %d would do it, but it doesn't. Aren't numbers in a plist just signed 32-bit integers?
|
# ? Jun 22, 2011 00:16 |
|
Carthag posted:It's been a long time since I've done any game code, but it seems like it would be less messy to have a single schedule/timer handle it. Hm, this might work if I can figure out how to implement it, shouldn't be too overly difficult, and it would still allow me to throw in a random seed every time something spawns. Looks like I am going to have to rewrite a bunch of code, your way makes more sense and should help with overall readability of the code.
|
# ? Jun 22, 2011 01:33 |
|
OK I've got something really strange going on here and I have no idea what's up. Contained in the header file KCAViewController.h is this:code:
code:
quote:TriviaViewController.m:27: error: 'shouldHideToolbar' undeclared (first use in this function) Why the hell would it compile and work when building with a device as a target but not when trying to archive it?
|
# ? Jun 22, 2011 04:14 |
|
What Xcode are you using, and where are you synthesizing your property? shouldHideToolbar = YES; is accessing the ivar directly, not the @property, for which you would need to do self.shouldHideToolbar = YES.
|
# ? Jun 22, 2011 05:00 |
|
rjmccall posted:What Xcode are you using, and where are you synthesizing your property? shouldHideToolbar = YES; is accessing the ivar directly, not the @property, for which you would need to do self.shouldHideToolbar = YES. Awesome! Setting it to self.shouldHideToolbar fixed it along with removing the (readonly) attribute. I'm using Xcode 4 but this app was built by another guy in Xcode 3. This begs the question of how or why doing things this way used to work and why it compiled for a device but not for archiving previously. I really don't get it. Now I've got to figure out why these Urban Airship class files are throwing Apple Mach-O Linker Errors. Ugh... e: nice, now i've learned all about adding frameworks kinda. hrmm Yodzilla fucked around with this message at 05:48 on Jun 22, 2011 |
# ? Jun 22, 2011 05:25 |
|
Carthag posted:It's been a long time since I've done any game code, but it seems like it would be less messy to have a single schedule/timer handle it. Sometimes you can't see the forest for the trees, this is exactly what I needed to do. Kudos. I'll even let you see the abomination that I call the solution: code:
ModeSix fucked around with this message at 06:08 on Jun 22, 2011 |
# ? Jun 22, 2011 06:03 |
|
Is it normal for the root view controller's viewDidLoad method to be called before the app delegate's application:didFinishLaunchingWithOptions: method?
|
# ? Jun 22, 2011 07:58 |
|
stray posted:Hm... that seems like drastic overkill. I don't need to create numbers you can dial from everywhere on Earth (yet); I just want to turn the number that I'm reading in from a plist into a nicely-formatted string that I can pump out to a UILabel. (I'm taking baby steps right now.) This should be pretty easy. Objective-C makes it quite a bit more cumbersome than other languages, but it's still fairly simple. If you're certain you have a 10 digit integer, you can do something like this: code:
|
# ? Jun 22, 2011 07:59 |
|
Doc Block posted:Is it normal for the root view controller's viewDidLoad method to be called before the app delegate's application:didFinishLaunchingWithOptions: method? That sounds abnormal but not impossible, especially if the root view controller is in your main nib file. Do you have a problem triggered by the ordering of the calls, or are you just curious?
|
# ? Jun 22, 2011 08:49 |
|
pokeyman posted:That sounds abnormal but not impossible, especially if the root view controller is in your main nib file. Do you have a problem triggered by the ordering of the calls, or are you just curious? Yeah, my app delegate is supposed to restore the app's state on startup, but since the root view is somehow getting loaded first, it will always act as if this is the first time the user has run the app. It's a universal app, started from the Window template, and I think the problem is just how I connected everything up. The root view controller is in a separate nib. edit: aaand it's fixed. Ask for help and immediately get it working yourself. I think the overall gist of it was that I had connected the root view controller to the main window's rootViewController property in Interface Builder (or whatever it's called now in Xcode 4) instead of doing it in code in the app delegate's application:didFinishLaunchingWithOptions: method. And when MainWindow.xib was loading, my root view controller would get loaded too because of the connection made in IB. Doc Block fucked around with this message at 09:10 on Jun 22, 2011 |
# ? Jun 22, 2011 08:54 |
|
Gordon Cole posted:This should be pretty easy. Objective-C makes it quite a bit more cumbersome than other languages, but it's still fairly simple.
|
# ? Jun 23, 2011 15:43 |
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
AlwaysWetID34 fucked around with this message at 17:29 on Jan 18, 2019 |
# ? Jun 23, 2011 16:58 |
|
WWDC 2011 videos are up.
|
# ? Jun 24, 2011 00:36 |
|
Small White Dragon posted:WWDC 2011 videos are up. Yesss. I don't think my wife understands why I want to watch videos of people giving powerpoint presentations, but I love these videos.
|
# ? Jun 24, 2011 01:29 |
|
lord funk posted:Yesss. I don't think my wife understands why I want to watch videos of people giving powerpoint presentations, but I love these videos. Tell her these are Keynote presentations. Totally better.
|
# ? Jun 24, 2011 04:41 |
|
Small White Dragon posted:WWDC 2011 videos are up. And just so we're all clear, all you need is the free developer account to watch the videos. So do it.
|
# ? Jun 24, 2011 10:11 |
|
Does this mean the WWDC NDA is gone?
|
# ? Jun 24, 2011 10:19 |
|
So I'm trying to implement push notifications using Urban Airship in an app and I'm absolutely confounded by these errors. I had this poo poo working last night and it compiles if my target is iOS Device but if I try to compile it to run in a simulator I get over a hundred Apple Mach-O Linke Errors like this:quote:Undefined symbols for architecture i386: And I just don't get it. I've included all of the frameworks that the UA sample app was using and I can't find any documentation on what those errors even mean. e: it's doubly confusing because it refuses to compile and run in the simulator but i can install it to my iPad and it works just fine. i really don't get it
|
# ? Jun 24, 2011 17:13 |
|
Yodzilla posted:So I'm trying to implement push notifications using Urban Airship in an app and I'm absolutely confounded by these errors. I had this poo poo working last night and it compiles if my target is iOS Device but if I try to compile it to run in a simulator I get over a hundred Apple Mach-O Linke Errors like this: It looks like the library doesn't even contain code for the simulator (i386).
|
# ? Jun 24, 2011 17:36 |
|
Which is weird because they explicitly say on their site that they new 1.0.5 version does contain the library. And whatever version of Urban Airship that Appcelerator uses works just fine in the simulator so I really don't know.
|
# ? Jun 24, 2011 18:02 |
|
Yodzilla posted:Which is weird because they explicitly say on their site that they new 1.0.5 version does contain the library. And whatever version of Urban Airship that Appcelerator uses works just fine in the simulator so I really don't know. Check this page out: http://support.urbanairship.com/customer/portal/questions/3170-push-api-libuairship-1-4-a-missing-required-architecture-i386
|
# ? Jun 24, 2011 18:04 |
|
Yeah that's the page where they poster is using 1.0.4 and UA says that i368 support is coming in 1.0.5. I'm currently using the latest version which is v1.0.5a so either something else is wrong or Urban Airship lied.
|
# ? Jun 24, 2011 18:18 |
|
So I removed all of my included frameworks and re-added them all again and it mysteriously works now. gently caress everything.
|
# ? Jun 24, 2011 18:44 |
|
wolffenstein posted:Does this mean the WWDC NDA is gone? As far as I know it's replaced with the Developer NDA, so you still can't talk about session contents on a forum such as this one. The rule of thumb I use: if I don't need to log in to see Apple's page/docs about it, I can probably talk about it. IANAL etc. but that's my thinking.
|
# ? Jun 24, 2011 20:25 |
|
I guess that's why it's hard to find much discussion about the things by googling around. Lot of them are really cool and I'd love to see what others think of them.
|
# ? Jun 24, 2011 21:10 |
|
|
# ? May 16, 2024 18:38 |
|
I'm displaying a UIPickerView dynamically based on a button press and want to select an item in the picker. If the orientation of the iPhone is portrait then calling [UIPickerView selectRow] works fine with animated being YES or NO. If the orientation is landscape, selectRow only works if I set animated to NO. If I attempt to animate the selection it fails and leaves the first item selected. I'm attempting to select the item in viewDidLoad - is there a better place to do this? Here's my controller code in case it helps. code:
|
# ? Jun 24, 2011 22:52 |