Ok, I feel like an idiot because I've spent hours trying to figure this out and literally cannot find any good resources on classes using protocols and physically implementing them. Apple tells you how to make a protocol, but as far as I can read, it does nothing as far as physically implementing its properties into objects that display on the screen. I want to make a very basic web browser. I have the framework set up with forward/back/reload/go buttons, but for the life of me cannot figure out how to make a UITextField address bar display the keyboard as a UIKeyboardTypeURL. I figured I would implement an AddressBar class which inherits from UITextField, and conforms to UITextInputTraits, but from there I don't know how to implement those specific properties I want, and so I get a 'default' keyboard when the application runs. As far as I've understood, I still have to declare AddressBar like a normal IBOutlet. I feel like once I understand the protocol stuff and how to implement them, things will be so much easier. Here is code I used; no matter how laughably bad it is, tell me where I type in what's likely a couple lines to make the keyboard show. I'm sure I probably hosed up somewhere in the properties. Pardon the lack of my own comments because I have like 30-40 lines of my own code at most and it didn't seem necessary. The AppDelegate .h/.m aren't modified since I didn't see a need to do so just yet. I'm trying really hard and I know I should be able to do this stuff, and I have at least a semblance of *something* working, but there are a few key things I seem to not understand just yet. If you can just correct my code or do something with it regarding how to specifically achieve what I want to achieve in this given situation, it would probably help a lot. I'm also going to kill myself if there's a simpler solution than tying the address bar into a UITextField. AddressBar.h: code:
code:
code:
code:
|
|
# ? Jan 9, 2012 21:24 |
|
|
# ? May 16, 2024 19:05 |
|
Don't subclass UITextField. Just use a UiTextField, and when initializing it, do: myTextField.keyboardType = UIKeyboardTypeURL; UITextField implements UITextInputTraits already. What's happening with your code is that it's keeping track of whatever traits you assign to it, but the superclass has no idea that they exist or what to do with them.
|
# ? Jan 9, 2012 22:56 |
PT6A posted:Don't subclass UITextField. Just use a UiTextField, and when initializing it, do: Where am I explicitly doing this? Every impression I get is to use it in a viewDidLoad method or initWithCoder method, but StackOverflow has numerous Q&As that give different answers as to what to do. I'm using a Storyboard for the project (may as well get used to them), and maybe that's affecting it, but as far as I understand, I should just be able to do this within that method and it should work: code:
|
|
# ? Jan 10, 2012 02:41 |
|
Yes, that's all you have to do. Or you can set it in Interface Builder. Also, think of a protocol as a contract between two objects/classes. When you declare that a class conforms to a protocol, you are just saying that the class implements the parts of the protocol that are marked @required in the protocol's header file, and may or may not implement any parts of the protocol marked as @optional. That's it. You still have to go and implement those methods. Doc Block fucked around with this message at 03:24 on Jan 10, 2012 |
# ? Jan 10, 2012 03:22 |
|
Sulk posted:Where am I explicitly doing this? Every impression I get is to use it in a viewDidLoad method or initWithCoder method, but StackOverflow has numerous Q&As that give different answers as to what to do. I'm using a Storyboard for the project (may as well get used to them), and maybe that's affecting it, but as far as I understand, I should just be able to do this within that method and it should work: Yeah, that should be working. You could try viewWillAppear too, but viewDidLoad should work. You can also select the type of keyboard you want for the text field in Interface Builder too.
|
# ? Jan 10, 2012 03:23 |
|
I'm having an annoying issue with getting text to center smoothly. I have some numbers that I'm trying to draw centered inside some circles, and depending on the size of the circle (which scales with the size of the view), the number will usually be off by a couple pixels horizontally, vertically or both. An example: The number jitters around as the view is resized. I think the problem might be that the position of the text is getting rounded off to the nearest integer. Does anyone know how to draw text at a sub-pixel position or have any other ideas on how to get the numbers to stay in place? I'm just using NSString's drawInRect:withAttributes: method with a center-aligned paragraph style and manually centering the rect's vertical position. Also this is on OS X, not iOS.
|
# ? Jan 10, 2012 07:14 |
|
Oh Jesus, I just got a call (at half past midnight in this timezone, to be clear) from a woman who could barely speak English and was having trouble installing an app or using her credit card or some combination of the above. Maybe putting my phone number on my website was not a great idea (either that or I should just ignore my business phone after a certain time...) Has anyone else had a bizarre experience like that?
|
# ? Jan 10, 2012 08:29 |
|
Has the behavior of the keyboard changed in 5.0? One of my views is automatically getting its frame adjusted when the keyboard appears/disappears. Under 4.3 the frame doesn't get changed. I can't find anything in the documentation that mentions any change. Anyone come across this?
|
# ? Jan 10, 2012 16:56 |
|
When I switch tabs in Xcode, sometimes it's scrolled to totally the wrong position. I have to go up to the method selection and select it. Does anyone know what's going on here? Am I doing something wrong, or is it just a bug?
|
# ? Jan 10, 2012 19:17 |
|
PT6A posted:Oh Jesus, I just got a call (at half past midnight in this timezone, to be clear) from a woman who could barely speak English and was having trouble installing an app or using her credit card or some combination of the above. Maybe putting my phone number on my website was not a great idea (either that or I should just ignore my business phone after a certain time...) You published a support number on the internet. If I was that lady, I'd think it was bizarre that the helpdesk rep sounded like I just woke him up.
|
# ? Jan 11, 2012 00:44 |
|
Gordon Cole posted:I'm having an annoying issue with getting text to center smoothly. I have some numbers that I'm trying to draw centered inside some circles, and depending on the size of the circle (which scales with the size of the view), the number will usually be off by a couple pixels horizontally, vertically or both. An example: Check out CGContextSetShouldSmoothFonts and CGContextSetShouldSubpixelPositionFonts. You can use [[NSGraphicsContext currentContext] graphicsPort] in your -drawRect: to get access to a CGContext.
|
# ? Jan 11, 2012 02:43 |
|
bumnuts posted:Has the behavior of the keyboard changed in 5.0? One of my views is automatically getting its frame adjusted when the keyboard appears/disappears. Under 4.3 the frame doesn't get changed. I can't find anything in the documentation that mentions any change. Anyone come across this? I haven't seen any changes like this. Is it a custom class of UIView that you're having problems with, or something in UIKit?
|
# ? Jan 11, 2012 02:44 |
|
LP0 ON FIRE posted:When I switch tabs in Xcode, sometimes it's scrolled to totally the wrong position. I have to go up to the method selection and select it. Does anyone know what's going on here? Am I doing something wrong, or is it just a bug? Pretty sure you're just getting the best that Xcode has to offer.
|
# ? Jan 11, 2012 02:44 |
|
pokeyman posted:Check out CGContextSetShouldSmoothFonts and CGContextSetShouldSubpixelPositionFonts. You can use [[NSGraphicsContext currentContext] graphicsPort] in your -drawRect: to get access to a CGContext. That sounds like exactly what I need! I'll check it out when I get home. Thanks! Edit: No luck It seems to have no effect. dizzywhip fucked around with this message at 05:38 on Jan 11, 2012 |
# ? Jan 11, 2012 03:05 |
|
pokeyman posted:I haven't seen any changes like this. Is it a custom class of UIView that you're having problems with, or something in UIKit? It's a subclass of UITableViewController, but I haven't overridden anything to do with the keyboard. It looks like the OS is automatically adjusting the contentInset.bottom to be the height of the keyboard. It's nice that it does this (and frankly should have done this all along) but it makes it hard to have the same code work across 4.x and 5.x.
|
# ? Jan 11, 2012 05:12 |
|
bumnuts posted:It's a subclass of UITableViewController, but I haven't overridden anything to do with the keyboard. It looks like the OS is automatically adjusting the contentInset.bottom to be the height of the keyboard. It's nice that it does this (and frankly should have done this all along) but it makes it hard to have the same code work across 4.x and 5.x. UITableViewController does try to get out of the way of the keyboard sometimes, but it's hardly new. Text, Web, and Editing Programming Guide posted:Note: As of iOS 3.0, the UITableViewController class automatically resizes and repositions its table view when there is in-line editing of text fields. Are you calling up to super in your -loadView and -viewWillAppear: and so on?
|
# ? Jan 11, 2012 08:37 |
|
Gordon Cole posted:That sounds like exactly what I need! I'll check it out when I get home. Thanks! Is the background transparent? I think it needs to be at most semitransparent for subpixel rendering to happen.
|
# ? Jan 11, 2012 08:47 |
|
pokeyman posted:Is the background transparent? I think it needs to be at most semitransparent for subpixel rendering to happen. It's totally opaque. I don't know if it matters for this particular situation, but I should mention that I'm using a non-layer backed view. I know layer-backed views have weird issues with doing sub-pixel text rendering, but those shouldn't apply here.
|
# ? Jan 11, 2012 10:45 |
|
Cocoa With Love had a post that might be helpful, it includes positioning a glyph: http://cocoawithlove.com/2011/01/advanced-drawing-using-appkit.html
|
# ? Jan 11, 2012 10:57 |
|
Carthag posted:Cocoa With Love had a post that might be helpful, it includes positioning a glyph: I actually stumbled upon this post a couple days ago while researching a different problem but I skipped over the character part . I won't be able to try this until later, but this looks like it'll work for sure since you're drawing the path yourself.
|
# ? Jan 11, 2012 20:02 |
|
Gordon Cole posted:It's totally opaque. I don't know if it matters for this particular situation, but I should mention that I'm using a non-layer backed view. I know layer-backed views have weird issues with doing sub-pixel text rendering, but those shouldn't apply here. Hmm, I'm out of ideas then. Sorry!
|
# ? Jan 11, 2012 21:37 |
|
Changed my question since I figured out qthe one I posted earlier I've added unit tests to a bundle project and get the following error: quote:2012-01-12 01:23:33.644 otest[12650:407] The test bundle at /.../DerivedData/.../Debug/PluginTests.octest could not be loaded because a link error occurred. It is likely that dyld cannot locate a framework framework or library that the the test bundle was linked against, possibly because the framework or library had an incorrect install path at link time. Things I've checked: - bundle is added to Bundle Loader in Test Target's Build Setting: $(BUILT_PRODUCTS_DIR)/Plugin.agplugin/Contents/MacOS/Plugin - bundle build is a Target Dependency in Build Phases. - bundle build is also in the scheme (both build & test phases). Carthag Tuek fucked around with this message at 01:36 on Jan 12, 2012 |
# ? Jan 11, 2012 21:42 |
|
Has anyone taken a class at Big Nerd Ranch? Another guy and I at work are tasked with getting up to speed on iPhone stuff, I have some experience but he's starting from scratch (but has done plenty of web programming). The boss would prefer to just send us somewhere for a week, they've used Pragmatic Programmer classes before. I'm wondering if they just re-hash what's in the books.
|
# ? Jan 12, 2012 01:53 |
|
A friend of mine did the Big Nerd Ranch course for Cocoa Programming. While it is re-hashing the book (which you get to keep a copy of), they do it at an accelerated pace, you meet and talk to other Cocoa programmers, and they cover everything but airfare. He thought it was well worth it.
|
# ? Jan 12, 2012 02:10 |
|
Carthag posted:Cocoa With Love had a post that might be helpful, it includes positioning a glyph: Success! It's a lot of code but it works perfectly. Thanks a bunch.
|
# ? Jan 12, 2012 02:29 |
|
Carthag posted:I've added unit tests to a bundle project and get the following error: Gah, I've tried just about everything now! Every setting I find online is either already set correctly, or it doesn't fix the problem. I've compared the build settings & schemes to a working test target in another project, and run otool -L on everything I could think of. There's nothing at all I can find that is linked to in a way that doesn't make sense! Also what's up with not saying what exactly the linking error is... Carthag Tuek fucked around with this message at 09:19 on Jan 12, 2012 |
# ? Jan 12, 2012 09:09 |
|
Maybe not the most helpful suggestion but: try GHUnit?
|
# ? Jan 13, 2012 01:35 |
|
I guess I'll have to try that out tomorrow. I still haven't found out what the problem is. Does GHUnit integrate with XCode (ie do test failures go in the isssue navigator / get shown in the code window)?
|
# ? Jan 13, 2012 01:58 |
|
I decided to have one last go at it before ditching OCUnit and it works now, although it seems like a hack. For future reference, I removed the bundle from the BUNDLE_LOADER var in build settings, and added all .m files to the Tests target. I guess it has something to do with the way .app classes vs. .bundle classes are loaded into the testing harness, cause .app classes don't need to be in the Test target. -- I'm building a queue (basically an NSMutableOrderedSet that gets items added to it during the course of the program). I want to periodically check this queue and handle the first object in it (and remove it). I suppose this is a good job for GCD? Or should I use an NSTimer for this? Edit: Ah, Timer dispatch sources Carthag Tuek fucked around with this message at 19:11 on Jan 13, 2012 |
# ? Jan 13, 2012 15:43 |
|
The OP says I can ask about getting a dev to design an application. I need something simple that I can run on my Iphone 4s that keeps track of a simple weight based inventory and allows me to mark sales that remove stock from the inventory automatically. I can photoshop up a few screens but the UI could be default buttons or text for all I care, as long as it's easy to read. Here is sort of a breakdown of what I need it to do via the interface Title Screen: Inventory Sale Inventory -Add Crop ---- Add Specific Food Item (name, 140 character description, weight, desired price per lb) -View Inventory sorted by Crop Sale - Add a sale of a specific food item by weight, so an input box with gram/oz/lb buttons next to it - It suggests a price based off the desired x/lb price, but allows me to input whatever price - Auto updates the inventory Anyway, fairly simple but apparently spreadsheets don't work that great on iOs and it's not like I'd know how to design the automated sale bit anyway. What would I be looking at to have something like this made? I've checked the various inventory, POS software stuff and all of it's too complicated for what I'm trying to do nor do most of them allow you to have items by weight. Quick Sale is sorta there but I hate that it syncs to a website and I'd be forced to price everything by the gram which is a hassle including too many maths. Morphix fucked around with this message at 00:13 on Jan 14, 2012 |
# ? Jan 14, 2012 00:10 |
|
Is there a good way to "debug" what your application has on iCloud?
|
# ? Jan 14, 2012 22:19 |
|
Morphix posted:Stuff. Well since you didn't request response by PM I assume responding publicly will be OK and it might help others with similar questions. The short answer is "it depends". If you just want a one-off for your own use, then I imagine a CS student or part-timer could knock it out for a few hundred bucks (give or take) and depending on exactly how complex it is. If you want a polished app and someone to help you get the app through the approval process to sell on the store, has experiece doing more professional development like localizing/translating, dealing with users and bug/crash reports, etc then you are looking at more money. By way of example and assuming I had time on my schedule, my price would probably start at 2000 and go up from there. If you want an integrated bug tracker, a graphic artist, translations, a website for the app, etc then that obviously adds to the cost. You will definitely get better responses and more accurate prices if you have mockups for the screens you want. Also make sure if you are spending more than a few bucks that you deal with someone who has their own app out on the app store and make sure you check that it really is their app and any references they can provide. Unfortunately there are a lot of crappy coders out there taking people's money and churning out absolute garbage in between parking cars at their "real" job. I know because I've had to clean up (re-write from scratch) their mistakes. Good developers are also in high demand so if someone has a completely free schedule that might be a red flag. I don't want to sound down on part-time devs, beginners, or students... Everyone has to start somewhere, just make sure you aren't paying top dollar and have the correct expectations up front. Having an eager student do a one-off app can be a great deal for you both. Having the same person write the app your 10,000 customers will use in the US, France, and China to interact with your company is a less appealing idea.
|
# ? Jan 16, 2012 19:59 |
|
Small White Dragon posted:Is there a good way to "debug" what your application has on iCloud? I don't know if there is an official way but I often write little apps that I run on the simulator or on my test devices to do tasks like this.... Eg: in the simulator you can access the real file system, so I have an app that can rip directories to a known location for inspection. I have another that has various UI layouts and writes both 1X and 2X screenshots for startup image purposes. I'm sure you could have a test app with the right bundle IDs and just have it dump everything it can see from iCloud to a local folder.
|
# ? Jan 16, 2012 20:03 |
|
Ender.uNF posted:Well since you didn't request response by PM I assume responding publicly will be OK and it might help others with similar questions. Thank you for the response, sorry I don't have PM on this account I guess. I'm looking for something one-off, not for store resale in anyway, in fact I was going to have another developer look through the code to make sure there is nothing that uploads any data to anywhere. I'll work on some props and repost here with some more info. What I'm looking for a good Excel spreadsheet could do, but alas can't get excel poo poo to run on an iphone and doing it via safari on google docs doesn't seem to give me much functionality.
|
# ? Jan 17, 2012 20:48 |
|
Some developers weighing in on the pricing of big prestige apps: http://stackoverflow.com/questions/209170/how-much-does-it-cost-to-develop-an-iphone-application
|
# ? Jan 19, 2012 02:00 |
|
OK, I've got a Core Data question. I'm working my way through the Stanford lectures, which are really, really helpful, but for my app, I'd like to have a table view that displays information sorted by date. The sorting I get, but is there a simple way with NSPredicate to ask for "all records with a unique month and year" to make creating sections in the table view easy, or do I have to do this myself? Basically, if the data is: 11/10/05 1 1 1 11/15/05 2 1 0 12/02/05 4 2 0 03/10/06 1 0 1 04/21/06 0 0 0 is there a way to get a set of 11/05, 12/05, 03/06, and 04/06 without going through every possible month and year with an NSPredicate of "between these dates" and checking to see how many records match?
|
# ? Jan 19, 2012 04:04 |
|
Khelmar posted:OK, I've got a Core Data question. I'm working my way through the Stanford lectures, which are really, really helpful, but for my app, I'd like to have a table view that displays information sorted by date. The sorting I get, but is there a simple way with NSPredicate to ask for "all records with a unique month and year" to make creating sections in the table view easy, or do I have to do this myself? Something like this I presume from looking at the docs a bit:
Now you have an array where each section is separated by their group headers + the indexes of the headers. Use this new array as the dataSource for the table view. Then in your delegate: - (BOOL)tableView:(NSTableView *)tableView isGroupRow:(NSInteger)row { return [headerIndex containsIndex:row]; } That should tell the tableview whether the object is a group header or not, and have it draw it accordingly. Note I haven't tried this yet, but will probably be building my own somewhere down the line. Carthag Tuek fucked around with this message at 05:09 on Jan 19, 2012 |
# ? Jan 19, 2012 05:05 |
|
Do any of you use TestFlight? Their crash reporting feature looks awesome, except it doesn't support AppStore releases. Is there a way to keep receiving crash reports? Or do you transition to something else?
|
# ? Jan 19, 2012 17:17 |
|
Sulk posted:AddressBar.h: I use this general pattern. It isolates the retain/release semantics in the property definition. Thanks to the Objective-C 2.0 runtime, even explicit ivars aren't a huge advantage over synthesized ivars (more info). Perhaps the method synthesis might not be such a big performance win, but I haven't noticed any performance issues since I don't need close-to-the-metal performance at the class level. In any case, you can directly access the synthesized ivars if you somepropertyname = _ivarname in your synthesis statement. SomeClass.h: code:
code:
* This means, for example, if you know of a private property in some third-party class, you can implement a category on it that declares methods *it already has*, and then include that header with the category on your code, and use those methods with no warnings from the compiler. OHIO posted:Do any of you use TestFlight? Their crash reporting feature looks awesome, except it doesn't support AppStore releases. Doctor w-rw-rw- fucked around with this message at 20:38 on Jan 19, 2012 |
# ? Jan 19, 2012 20:30 |
|
|
# ? May 16, 2024 19:05 |
|
Hey friendly programmer goons. I'm looking for a developer looking for some extra cash to help me with a project I want to implement. It's very simple, so I don't think you need to be a professional to do this. I'm looking for a pretty simple application. I will send all the necessary fonts and logos and text needed. What I need the app to do is have 4 buttons on the home page, that once clicked, displays some text that I will provide on a different page, as well as a "Find My Race!" button (will describe this later.) I also need a "Go back home" button that takes you to the home screen. Also, on the home page, I will need a facebook and twitter button. As for the find my race button, I don't know how easy or hard this would be for a developer, but this is what I'm picturing in my head. They press the button. Either the GPS goes off and locates them, or they can input their zip (Whichever is easier). Then, after that, the application will find the nearest event to that person based on where they are located. If that part is too difficult, I can deal with just the other features working nicely. Shoot me an e-mail at rjkaszuba at gmail if you are interested. I will pay a fair amount, don't want to cheap anyone out!
|
# ? Jan 19, 2012 20:54 |