|
So it looks like I'm actually getting somewhere with ingesting an XML feed and displaying the results thanks to this handy guide but there's one thing about it I don't quite understand. That tutorial and just about every other one I've found relies on the assumption that your tableView is going to be the main view on your xib. However in this app it has to be a subview and I don't get how that's possible. For example, in my controller's .h file I'm extending the class like so: code:
code:
1) any line that contains self.tableView will break because now the tableView is inside of another view. I'm not sure how to access the tableView as self.view.tableView doesn't seem to work. I really don't get this part. 2) even though I have the tableView's DataSource and delegate set to File's Owner none of the tableView initialization functions are getting called when the view loads. Setting the tableView's Referencing Outlet to the master view doesn't seem to do anything either. Sorry for all of the questions but I swear every little bit helps as I've come a long way in a few short days. e:poo poo sorry fankey i didn't mean to bump to the next page before your question had a chance to be answered. here's what he asked
|
# ? Jun 25, 2011 03:10 |
|
|
# ? May 16, 2024 18:00 |
|
Yodzilla posted:1) any line that contains self.tableView will break because now the tableView is inside of another view. I'm not sure how to access the tableView as self.view.tableView doesn't seem to work. I really don't get this part. self.tableView just means your class has a @property UITableView* tableView. It doesn't matter if that table view is inside of another view, or is the main view, or isn't loaded anywhere at all. If you want those references to work in a non-UITableViewController, then you have to provide that property yourself.
|
# ? Jun 25, 2011 21:12 |
|
Yeah I figured it out last night. I didn't realize that if you want a tableView as a subview you have to extend <UITableViewDelegate, UITableViewDataSource>, declare ithe tableView object in your .h file, synthesize it in your .m, and then have the Referencing Outlet go back to the tableVIew you declared in the file's owner. Once it did that it worked great! I'm still not sure WHY all of this stuff works the way it does but thankfully I was able to get it pulling down RSS data and clicking through to other pages just fine. I guess the only thing now is that I've got to figure out how to get the app not to hang while it loads the images.
|
# ? Jun 26, 2011 00:30 |
|
What don't you understand? You can't access self.whatever if whatever isn't a declared property of self. UITableViewDelegate and UITableViewData aren't classes you're extending, they're protocols. Basically, saying that your class conforms to a certain protocol is a way of telling other classes that your class implements certain methods. For instance, if your class is the delegate for a table view, the table view can check to see if your class has been declared as conforming to the UITableViewDelegate protocol, and know that your class implements the methods necessary for the table view to tell your class when something happens, etc.
|
# ? Jun 26, 2011 02:12 |
|
Gotcha. See I'm coming from a primarily .Net and Java background so doing things this way is a bit nebulous to me. I was basically given this project because "Hey you know how to make Droid apps, this probably the same thing!" so it's been a bit of a trial by fire combined with It also doesn't help that no one I know professionally does any mobile development at all so the entirety of my resources have to come from Googling madly for code snippets and making sense of them along with the help you guys have provided. Yodzilla fucked around with this message at 02:19 on Jun 26, 2011 |
# ? Jun 26, 2011 02:17 |
|
Keep in mind that Cocoa and Cocoa Touch are pretty big on the whole model-view-controller paradigm. And protocols are pretty much the same thing as interfaces in C# and Java, as far as I know. Read these two important links from the OP: The Objective-C Programming Language and Memory Management Programming Guide. Also, even though you're a .NET and Java programmer, From C++ to Objective-C might be at least a little helpful, and is fairly short. This one helped me a lot. And if you have questions about a specific class, a good place to start is Apple's own docs for that class (which are usually the first or second result of googling for the class name). Doc Block fucked around with this message at 08:35 on Jun 26, 2011 |
# ? Jun 26, 2011 08:18 |
|
pokeyman posted: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. I wish I knew why Apple is so NDA-happy about this stuff. Anyone with a pulse can get a free basic developer account. All it takes is a hundred bucks to get access to the prerelease SDK, and the tech press is perfectly happy breaking the NDA anyway. It seems to stifle interaction between developers since you are not supposed to talk about it under except under the watchful gaze of Apple's dev forum. I remember 2 years ago (the last year Apple didn't post these sessions) a guy in my local Cocoa dev social group went to WWDC. From the way he refused to talk about any of it under pain of the WWDC NDA, you'd think he was protecting nuclear weapons secrets, not iOS 3.0 APIs.
|
# ? Jun 26, 2011 20:05 |
|
kitten smoothie posted:I wish I knew why Apple is so NDA-happy about this stuff. Anyone with a pulse can get a free basic developer account. All it takes is a hundred bucks to get access to the prerelease SDK, and the tech press is perfectly happy breaking the NDA anyway. Apple didn't get its reputation for being one of the most litigious out there for no reason! My suspicion is they just want it as an option to sue the poo poo out of someone who starts talking bad about their stuff in public.
|
# ? Jun 27, 2011 00:37 |
|
xzzy posted:Apple didn't get its reputation for being one of the most litigious out there for no reason! It did occur to me just now it might be because the presence of a feature in a beta OS image or SDK libraries could be taken as a commitment to actually deliver it in a final build. That way if some beta feature ends up getting axed before release and TUAW or Techcrunch tries to crucify them for it, Apple Legal can send them something reminding them that they shouldn't have talked about Fight Club. Or if some end user sues, Apple can shoot it down by saying the user should never have known about it anyway. I used to work for a big software company that did something similar. They didn't NDA the heck out of everything, but every brochure, PowerPoint deck, etc that discussed planned features had a standard disclaimer that said we in no way were committing to deliver anything in there -- so don't go dropping a few hundred grand on our software and then sue us when some feature isn't in the box. kitten smoothie fucked around with this message at 01:29 on Jun 27, 2011 |
# ? Jun 27, 2011 01:27 |
|
Yeah, I think Apple's insistence on NDAs is just part of their "we don't announce products until they actually ship" MO. If you watch the "Full Screen and Aqua Changes" WWDC video, for example, they discuss some stuff near the end that pretty clearly hints at future hardware. Of course even in the session they never make any direct reference to that. But I bet in a year or two Steve will get up on stage and present PENUS PENUS PENUS to a cheering audience, pointing out that they're the first to accomplish that, only to top it off with a "x% of apps in the App Store already support PENUS PENUS PENUS".
|
# ? Jun 27, 2011 22:14 |
|
If I had to guess I'd say it's more likely an issue with patent rights. From http://www.tms.org/pubs/journals/JOM/matters/matters-9405.html quote:Second, the use of confidentiality agreements can prevent the forfeiture of valuable patent rights. Under U.S. law and in other countries as well, the public disclosure of an invention can be deemed as a forfeiture of patent rights in that invention. A properly drafted confidentiality agreement can avoid the undesired—and often unintentional—forfeiture of valuable patent rights. My non-lawyer understanding is that once something is public knowledge you loose the ability to file a patent. By wrapping things up in an NDA you can claim it was still confidential and are able to file a patent. I haven't read the Apple NDA to see if this applies but I know my work has used an NDA to make sure we could still patent things before releasing a product.
|
# ? Jun 27, 2011 22:44 |
|
mc.schroeder posted:If you watch the "Full Screen and Aqua Changes" WWDC video, for example, they discuss some stuff near the end that pretty clearly hints at future hardware. Of course even in the session they never make any direct reference to that. But I bet in a year or two Steve will get up on stage and present PENUS PENUS PENUS to a cheering audience, pointing out that they're the first to accomplish that, only to top it off with a "x% of apps in the App Store already support PENUS PENUS PENUS".
|
# ? Jun 27, 2011 23:31 |
|
Zhentar posted:self.tableView just means your class has a @property UITableView* tableView. Doc Block posted:What don't you understand? You can't access self.whatever if whatever isn't a declared property of self. Note that you don't need a @property declaration. A regular -(UITableView *)tableView method will also work. Dot-syntax and properties are just alternate ways of calling and declaring accessor methods. mc.schroeder posted:If you watch the "Full Screen and Aqua Changes" WWDC video, for example, they discuss some stuff near the end that pretty clearly hints at future hardware. They've been referencing this hypothetical hardware since the "Resolution Independent UI Release Notes for Mac OS X v10.4." It's seriously been that long that they've been hammering on high-resolution OS X.
|
# ? Jun 28, 2011 06:29 |
|
I wrote an iPhone app for work and am now in the process of doing the same thing in Blackberry WebWorks. I would just like to say that the iOS SDK, tools, and documentation are amazing and I miss them very much.
|
# ? Jun 28, 2011 20:11 |
|
Anyone used an html page and web view for their app help file? I can muddle my way through design but I'm really just looking for a product, template, or whatever that will make it easier to create a page that doesn't look like absolute dog-crap. I've been scouring template sites but can't find anything suitable so far.
|
# ? Jun 29, 2011 00:36 |
|
Ender.uNF posted:Anyone used an html page and web view for their app help file? I can muddle my way through design but I'm really just looking for a product, template, or whatever that will make it easier to create a page that doesn't look like absolute dog-crap. I've been scouring template sites but can't find anything suitable so far. Simple is good. Send me your HTML and I'll make it purdy for you, since you've answered many questions of mine here.
|
# ? Jun 29, 2011 02:08 |
|
I can vouch for Lumpy's good design work.
|
# ? Jun 29, 2011 02:25 |
|
Lemme just go ahead and post this: UIWebView Must Die
|
# ? Jun 29, 2011 09:50 |
|
Doc Block posted:Lemme just go ahead and post this: UIWebView Must Die Wow, his comments about how slow UIWebView is explains why when I used the Laker framework for an app, it was REALLY slow moving between pages. http://www.lakercompendium.com/
|
# ? Jun 29, 2011 14:57 |
|
Doc Block posted:Lemme just go ahead and post this: UIWebView Must Die
|
# ? Jun 29, 2011 16:18 |
|
skidooer posted:Funnily enough, I just started playing with CoreText last night. Who says it isn't copy/paste-able? Wait, are you saying you implemented your own custom text selection, which works and behaves exactly like the native one, including markers, loupe and so on, directly on top of low-level CoreText APIs? In one night?
|
# ? Jun 29, 2011 16:55 |
|
mc.schroeder posted:Wait, are you saying you implemented your own custom text selection, which works and behaves exactly like the native one, including markers, loupe and so on, directly on top of low-level CoreText APIs? In one night?
|
# ? Jun 29, 2011 17:10 |
|
skidooer posted:I wish. No, it is UITextView backed, so it uses the native controls. It works very well for what I need, though I realize that wouldn't be suitable for all situations. I just was poking fun at one of the comments in the article. Wait, so you implemented a UITextView that does syntax coloring? Can you give any tips? I have a project in my mind that would have a use for that and I looked at Core Text a bit, but I never got to dive in further. Does a UITextView make it fairly easy to style it's backing store?
|
# ? Jun 29, 2011 17:59 |
|
Lumpy posted:Simple is good. Send me your HTML and I'll make it purdy for you, since you've answered many questions of mine here. Awww shucks I will send you what I have and my sad attempt to make something more than 1996-esque html. Many thanks! edit: Also, remember to thank your designers kids. Simulated fucked around with this message at 18:41 on Jun 29, 2011 |
# ? Jun 29, 2011 18:35 |
|
I'm having some trouble with custom fonts being applied to button and I'm not sure what the best way to handle it is. In the interface builder I can choose the font for a button but it's reading from the fonts that I have on my system, not the fonts that the app has access to. I've included the font file that I want to use as a Reference in my project and in the Info.plist I've added a "Fonts provided by application" array with one item, the name of the file in this case BerkeBol for Berkeley Bold. It seems that selecting Berkeley Bold in the interface builder doesn't do anything as it just goes back to whatever the default is and trying to apply the font programatically doesn't seem to work either. code:
|
# ? Jun 29, 2011 20:30 |
|
Yodzilla posted:I'm having some trouble with custom fonts being applied to button and I'm not sure what the best way to handle it is. In the interface builder I can choose the font for a button but it's reading from the fonts that I have on my system, not the fonts that the app has access to. I am doing this exact thing and it is working for me. Make sure: 1. The Fonts Provided by Application in info.plist must be the *exact* filename, including case and extension. If your font file doesnt have an extension, give it the correct one (tg: ttf). 2. The font name often doesn't match what you might consider a sensible value, so double-click the font file to open it in Font Book. Look at the title, which should be the "Family Name" of the font. 3. Now call [UIFont fontNamesForFamilyName:@""] with that title then log those array values to the console. That should tell you the real exact name(s) of the font to pass to fontWithName:. Use the names exactly as printed, case and all.
|
# ? Jun 29, 2011 20:58 |
|
Holy poo poo that got it working. I also downloaded a new file in case the old one was corrupt or something, added the .ttf extension, and readded it to the root of my project because gently caress it I just want to get this stupid poo poo working. Also I found this handy code for listing all of the font families available to your iOS app: code:
|
# ? Jun 29, 2011 21:17 |
|
Yodzilla posted:stuff You are welcome. Also just for people who are new to the platform, that example code is weirdly allocating memory that isn't necessary. I know you didn't write it but I don't want people to see this thread and think you need to do that. This code is cleaner and faster: code:
I can only guess the original author did that thinking the array from UIFont was going to disappear but that's not possible. Worst-case, you could send a retain message to the array (which retains all the objects it contains anyway) then release it later (or assign it to a retain property). But again, that's all a bit pointless. ProTip #8273: "for(type name in collection)" syntax is much faster to execute than any other pattern and you should use it unless you explicitly need the numeric index of an object.
|
# ? Jun 30, 2011 00:06 |
|
What are some popular (?) options for developers not wanting to code in Objective-C? I'd love to use Unity3D but I want a 2D game... Another choice is Monotouch but it doesn't seem very popular what-so-ever for games. Are there any games in the top 20 that aren't written in pure Objective-C (with cocos2d most likely?)
|
# ? Jun 30, 2011 18:12 |
|
What's wrong with Objective-C?
|
# ? Jun 30, 2011 18:28 |
|
Vinlaen posted:What are some popular (?) options for developers not wanting to code in Objective-C? Check the OP.
|
# ? Jun 30, 2011 18:32 |
|
I feel like its harder to go through all the loops and bounds to not use Objective-C, than it is to learn and use Objective-C.
|
# ? Jul 1, 2011 05:04 |
|
Yakattak posted:I feel like its harder to go through all the loops and bounds to not use Objective-C, than it is to learn and use Objective-C.
|
# ? Jul 1, 2011 05:11 |
|
Small White Dragon posted:A number of games (especially ports) simply define an AppDelegate and UIView subclass in Objective-C, and then handle everything else in C. Objective-C is a superset so they're close enough.
|
# ? Jul 1, 2011 05:13 |
|
Yakattak posted:I feel like its harder to go through all the loops and bounds to not use Objective-C, than it is to learn and use Objective-C. You can get pretty far learning just enough to translate library calls in the docs to your language of choice. Though I'd argue one's understanding of how to use said libraries benefits enormously from understanding its native and targeted languages.
|
# ? Jul 1, 2011 18:42 |
|
Rhetorical question: Why is using iAds together with UITableViewController such a huge PITA, especially given how central table views are to iPhone apps and how heavily Apple pushes you to use UITableViewController? You can't use header/footer because your app will be rejected (the Ad can't be scrolled offscreen). You can't subclass UITableViewController or muck with its view hierarchy because it assumes that it's self.view and self.tableView are one and the same (and forces the tableView to take up the available space). Attempting to mess with this will crash or just make the table view invisible. If you have your view controller inherit from UIViewController instead, you lose a whole bunch of built-in stuff. You have to manually clear selection when the view reappears, manually hook up the delegates, etc... but the biggest one is the view no longer scrolls to make text fields visible when the keyboard comes on-screen. I've searched and searched and there are about 10 different solutions to this problem involving mucking with content insets, moving the table view's origin, etc. All of which have problems (they need intimate knowledge of the table view contents to know when a first responder is activated/deactivated, they don't animate properly like the UITableViewController does, they don't handle all orientations, etc). I wish I could create my own container view but that is verboten in the current SDK. It really seems like Apple needs a container that handles iAds automatically or needs support for non-scrolling headers/footers in UITableViewController/UITableView.
|
# ? Jul 3, 2011 21:45 |
|
Ender.uNF posted:and how heavily Apple pushes you to use UITableViewController? They do? I must have missed that. The UITableViewController is only like two dozen lines of code worth worth of minor convenience functions to make implementing a simple tableview easy. You really should just stop trying to force it into doing what you want and use a UIViewController regardless of what Apple is pushing.
|
# ? Jul 3, 2011 23:32 |
|
Zhentar posted:They do? I must have missed that. The UITableViewController is only like two dozen lines of code worth worth of minor convenience functions to make implementing a simple tableview easy. You really should just stop trying to force it into doing what you want and use a UIViewController regardless of what Apple is pushing. Have you tried to duplicate it's keyboard scroll functionality when moving between UITextView cells? Perhaps I'm totally missing something here.
|
# ? Jul 4, 2011 00:03 |
|
How would you accomplish a custom view (or whatever it would be called) like the 'downloads' window in Firefox? Do you have to create a view that procedurally adds all the items like the icon and text labels, or is there an easier way? Are they all held in some sort of existing class?
|
# ? Jul 4, 2011 15:54 |
|
|
# ? May 16, 2024 18:00 |
|
Bob Morales posted:How would you accomplish a custom view (or whatever it would be called) like the 'downloads' window in Firefox? I'll assume you're just interested in the view part, and none of the possible implementation details. Well, it's its own window, so I'd start with a subclass of NSWindowController. There's two main parts: the scrollable list of downloads and the little status bar at the bottom. Easiest first: the status bar is just (in order) a label, an NSPathControl, then a standard push button. For the lits of downloads, I'd use an NSCollectionView. For its Item, the view has an image view (for the icon), two labels (for the filename and done/percentage), then two hyperlink buttons (make your own or grab from e.g. BWToolkit). This can all be done in nibs, and if you end up using bindings there's very little code that needs to be written at all. I'll go a bit into implementation: have your window controller subclass maintain an array of paths, then plug it into an NSArrayController. Bind the collection view to the array controller, then bind each part of the item view (icon, filename, etc.) to the item itself. Here's where you write a bit of code: implement icon and filename properties on the collection view item that derives their values from the path (make sure to use keyPathsForValuesAffectingValueForKey:) , then implement a couple IBActions for the open and remove links that just hands the path off to NSWorkspace or the array controller.
|
# ? Jul 4, 2011 19:50 |