|
How are you printing out the date? If you're 1 second from midnight you may be in Saturday still depending on your date formatter. Also what calendar are you using?
|
# ? Jan 9, 2015 20:22 |
|
|
# ? May 17, 2024 15:31 |
|
Not printing out the date, just looking at the NSDate object's description in the debugger. I've tried using the [NSCalendar currentCalendar] or also the Gregorian calendar and both give the same results. I've also tried setting the timezone to no avail.
|
# ? Jan 9, 2015 20:31 |
|
NSDates are always printed in UTC, so keep that in mind.
|
# ? Jan 9, 2015 21:07 |
|
I got angry and ended up doing this instead:code:
|
# ? Jan 9, 2015 21:47 |
|
Has anyone in the history of Core Data ever stuck fetch request templates into the model? A good reason to do so is eluding me. Heck, a bad reason to do so is eluding me.
|
# ? Jan 10, 2015 13:52 |
|
Just-In-Timeberlake posted:That would be great, thanks. https://github.com/dcramps/scrollsample Most of the magic happens in scrollViewDidScroll:. I wouldn't really recommend the alpha stuff on a tableview cell like that, but it was a quick and dirty way of making it look similar to the Shazam implementation.
|
# ? Jan 11, 2015 21:37 |
|
I have a problem with opening a UIDocument in a timely manner, and I think it’s because its asynchronous behavior is pushing the end of a busy queue. Here's the scenario: 1. At launch the app scans the Documents folder for all the user's documents. 2. For each one, a UIDocument is allocated, -readFromURL: is called, and is metadata is opened so that things like tags can be cached. 3. Each UIDocument is UIDocumentChangeCleared, and -closeWithCompletionHandler is called. This causes it to -dealloc. Meanwhile, the app has already finished launching, and the user can select a new document to load. If they do this before all the above scanned documents have -dealloc called, there is a looooooong wait before it opens until all the -dealloc calls finish. How can I track this down? I’ve tried every iteration of moving the scan to its own background thread, but the -openWithCompletionHandler call on the user-selected document always waits for the scan to finish.
|
# ? Jan 12, 2015 17:01 |
|
status posted:https://github.com/dcramps/scrollsample Thanks! This helps a lot. e: double thanks, for some reason it has never occurred to me that UITableView is a subclass of UIScrollView :facepalm: Just-In-Timeberlake fucked around with this message at 20:55 on Jan 12, 2015 |
# ? Jan 12, 2015 17:33 |
|
I'm attempting to draw a string ( in this case a single character of a font that contains icons ) with an outline. Using this codecode:
For whatever reason the outline doesn't appear at the left and bottom.Is there a better way to draw text with an outline that will give me a uniform stroke? Edit: I know a stroke of 1 will only get me a 0.5 stroke outline since the stroke should be centered on the path. A stroke of 2 has a similar ununiformity fankey fucked around with this message at 22:08 on Jan 12, 2015 |
# ? Jan 12, 2015 21:47 |
|
Try offsetting your drawing position by 0.5 pixels
|
# ? Jan 13, 2015 07:24 |
|
Better, but still isn't uniform. It ends up making it look like a bezel and not an outline, which is what I'm going for.
|
# ? Jan 13, 2015 19:12 |
|
Why are you drawing the fill after the stroke? Seems reversed to me.
|
# ? Jan 13, 2015 19:25 |
|
Take into account the width of the stroke when drawing your fill. See what happens when you make the stroke width 2 and then offset your fill by +1 +1 or +0.5 +0.5. Also, it might be strangeness resulting from it being done with text rendering. Try converting that particular glyph into a CGPath and then drawing that.
|
# ? Jan 13, 2015 19:59 |
|
lord funk posted:Why are you drawing the fill after the stroke? Seems reversed to me. Since the stroke is centered on the geometry, if you draw the stroke after the fill it will encroach on the glyphs.
|
# ? Jan 13, 2015 21:34 |
|
Doc Block posted:Take into account the width of the stroke when drawing your fill. See what happens when you make the stroke width 2 and then offset your fill by +1 +1 or +0.5 +0.5. Looks like the CGPath approach is the best - I can get a perfectly uniform stroke outline. The only problem is I can't get the correct glyph from my symbol font. I don't know if the issue is related to the fact that the font starts at glyph 0xF100 but when I pass the single character string ( which works perfectly fine with [NSString drawInRect:] ) I get the wrong glyph. The code below gives me 0xF121 when I pass in 'B' ( 0x0042 ). Something's is probably wrong in my CoreText code - I was mainly doing Physics 101 units conversion to get from a NSString to a CGPathRef. code:
|
# ? Jan 13, 2015 23:22 |
|
Could someone give me a quick rundown on FMDB? Is generally preferred to use than the standard sqllite libraries? I've done some messing around with sqllite and I can create my DB in the 'documents' folder. Is there anyway to transfer that database to my computer? I think you can include a .sql or whatever file in your xcode project and have it be a part of the IOS app but that's a one way street, right?
|
# ? Jan 14, 2015 02:58 |
|
TheReverend posted:Could someone give me a quick rundown on FMDB? I haven't actually used FMDB but from the many times I've looked at it, it's a handy but small wrapping of the SQLite library with a dispatch queue convenience. If it makes you more comfortable then go for it, if you don't think you need it then you're probably right. You can plug your device into iTunes (cable or wifi if wifi syncing is enabled) to get data in and out of the documents folder. Otherwise you can attach it to an email, airdrop it, whatever you feel the need to do. Be aware of options like write-ahead logging that turn your database into a multi-file affair (i.e. use FMDB/SQLite API to move the database around if it's more than one file).
|
# ? Jan 14, 2015 03:53 |
|
TheReverend posted:Could someone give me a quick rundown on FMDB? TheReverend posted:Is generally preferred to use than the standard sqllite libraries? TheReverend posted:I've done some messing around with sqllite and I can create my DB in the 'documents' folder. TheReverend posted:Is there anyway to transfer that database to my computer? TheReverend posted:I think you can include a .sql or whatever file in your xcode project and have it be a part of the IOS app but that's a one way street, right?
|
# ? Jan 14, 2015 05:49 |
|
Doctor w-rw-rw- posted:Don't do that lest you risk rejection from the App Store: SO link. Put it in the Caches directory: Apple docs. Unless your app is explicitly something which edits SQLite files, or you use SQLite as a file format for the data you actually care about saving. My thinking was that if a user's database got a hosed up they could send me the .sql file and I could see what went wrong/ try to fix. Thanks though. I'm going to give FMDB a look.
|
# ? Jan 14, 2015 06:42 |
|
TheReverend posted:Well gently caress. Ah. Yeah you can definitely do that, but you'll have to do it in a way other than through keeping it in the Documents folder. Creating a file URL and sharing it to email would be a good way to do that. Of course, this is only possible if you don't crash on startup when trying to read your database. Also, .sql is usually the file extension for text sql containing stuff like inserts and stuff to be inserted into databases. .sqlite is the file extension for the actual databases. Don't call your database files sql files and don't call your database files sql files.
|
# ? Jan 14, 2015 06:47 |
|
Doctor w-rw-rw- posted:Put it in the Caches directory: Apple docs. Just a note (for the OP, I assume you know this Doctor), the system can and will delete the contents of your app's Caches directory while your app is not running. If you're genuinely caching replaceable data in your database then put it in Caches, otherwise you want the Application Support directory.
|
# ? Jan 14, 2015 06:56 |
|
Thanks everyone. Slowly but surely getting the hang of it. File url sounds like what I want to do and I'll def put it in the support directory.
|
# ? Jan 14, 2015 07:40 |
|
pokeyman posted:Just a note (for the OP, I assume you know this Doctor), the system can and will delete the contents of your app's Caches directory while your app is not running. If you're genuinely caching replaceable data in your database then put it in Caches, otherwise you want the Application Support directory. Ah yeah, sorry, quite right, I generally write stuff that consumes web APIs, and persistence isn't a strict requirement. And a re-reminder that if you're not using the system sqlite3, you may have WAL disabled. I suggest enabling it (just need to run a pragma statement). Free speed, yo. E: Actually, not free because you want to be able to send the file, but I don't really know the scope of your project so I don't know what's a good tradeoff for you. Doctor w-rw-rw- fucked around with this message at 08:16 on Jan 14, 2015 |
# ? Jan 14, 2015 08:14 |
|
Hey guys, I have an unusual question, and please forgive me if this isn't a good place to ask.. It's not a question specifically about code, however this seemed to be the best place to find someone who could answer my question. Here goes.. I want to propose to my girlfriend, and I want to do it in a unusual and specific way so I can actually surprise her (because she knows it's coming). This may sound like (or be) a dumb way to do it, but I before I resigned to the traditional method I wanted to at least explore a more memorable and unique approach. My idea was to somehow replace her favorite iPhone game that she plays in the evening to unwind before bed (while her guard is down) with an app that has the same icon, but rather than loading the game, it would show her a series of 2 or 3 short messages that will basically be the set-up to me popping the question. These messages could advance one to the next with a time delay, but ideally with a button press or swipe so I know she doesn't miss it. It could also just be image files rather than text, I'm very photoshop savvy. That's really it. It would be extra cool if it were recording video from the front camera while this was happening to get her reaction but it's not absolutely crucial. I'm not sure how I'll get the phone away from her long enough to load it up and all that but I'll figure something out. The problem is I haven't done any coding since the late 90's when I had a brief stint making a few lovely pong-esque games with Visual Basic (does that even exist still?). I don't have a lot of time either, maybe a month, so I don't know that I could learn how to pull it off in time with my day-job and all. So what I was really hoping to do was commission someone to do it. I just don't know how kosher that is to ask within SA. I pm'd one of the mods of sa-mart to ask him if that was ok for me to make a [buying] thread over there, because I know any transactions need to be contained to sa-mart, but I'm still awaiting a reply. It's an unusual request so I wanted to make sure it was within the rules. So I guess I'm asking where or how you guys think I should solicit such a service, be it sa-mart or some external place that does that kind of thing. OR, if it sounds like a simple enough thing to pull off that I could figure it out with a few tutorials despite my limited experience. I'd certainly be willing to try. Any guidance you can offer would be much appreciated, and again forgive me if this is not appropriate in any way. I'll edit this all out if that's the case. Thanks!
|
# ? Jan 14, 2015 22:36 |
|
That sounds like a cute plan. I'd help you out if I weren't so insanely overloaded at the moment.
|
# ? Jan 14, 2015 23:12 |
|
Make a web page and save it as a Bookmark onto the home screen. I think you just need to set the favicon to whatever image you want, which would be the game's app icon? I didn't do much research into this but that'd be the easiest way to do all of it without delving into too much coding. Just simple html/css/javascript.
|
# ? Jan 14, 2015 23:14 |
|
So all you want the app to do is display a few messages, maybe nice photoshop images? Sounds pretty easy. There will just be some provisioning profile mucky muck to get the app on her phone.
|
# ? Jan 14, 2015 23:14 |
|
Doh004 posted:Make a web page and save it as a Bookmark onto the home screen. I think you just need to set the favicon to whatever image you want, which would be the game's app icon? I didn't do much research into this but that'd be the easiest way to do all of it without delving into too much coding. Just simple html/css/javascript. Interesting! Right after I posted, I had a thought that the app could even just be a browser that displayed a webpage that I made, but your idea certainly simplifies it further. I'll tinker and see if it could work. Edit: I wonder if I could make a shortcut to a video file, however playing with my phone now I don't think I can even add a direct shortcut to a picture/video to the home screen, let alone one with a custom icon. Jaypeeh fucked around with this message at 23:55 on Jan 14, 2015 |
# ? Jan 14, 2015 23:38 |
|
Jaypeeh posted:Interesting! Right after I posted, I had a thought that the app could even just be a browser that displayed a webpage that I made, but your idea certainly simplifies it further. I'll tinker and see if it could work. Check out the Safari Web Content Guide, specifically the section where it talks about what it calls "Web Applications". It'll talk about how to set the home screen icon, the image that displays while it's loading, and how to hide the address bar and such. You'll probably need to run a lil web server on your computer and visit it on the iPhone in order for it to pick up all the icons and stuff, but that's easy to do (e.g. in Terminal, cd to the directory then run python -m SimpleHTTPServer). Set up a cache manifest (also discussed in the linked guide under "Storing Data on the Client") so it'll run without your toy web server running. You can probably snipe the other app's icon from its bundle somehow, and even its launch image if you want to keep up the ruse a few seconds longer. You can include video, do some JavaScript gesture stuff, whatever you need, it's just a webpage. I think a month is plenty of time to bang this out. And great idea!
|
# ? Jan 15, 2015 04:11 |
|
What is suggested by a crash log during an iOS app launch that mentions "[vm-pageshortage]" in the "reason" column for several processes? I'm on iOS 8.1.2 using an iPad 3,3. Once it started happening it was consistent when launching that app. I believe the app began launching, as the launch image disappeared and a spinner started animating, but something crashed shortly thereafter. A reboot fixed it and now I can launch the app just fine. This isn't my app and I'm not trying to fix it or anything, I'm just curious about what might be happening behind the scenes. The crash log isn't an app-specific one, it just lists all the processes running. Xcode lists "Process" as "Unknown" and "Type" as "Unknown" in the device logs sheet. And I dunno how relevant it is, but from the second section of the crash log: code:
|
# ? Jan 15, 2015 08:20 |
|
pokeyman posted:This isn't my app and I'm not trying to fix it or anything, I'm just curious about what might be happening behind the scenes. That's a low memory log - the OS has run out of memory and had to kill a visible app to keep the system alive. When it does this, it logs out the memory usage of the system daemons and the app so you (and Apple) can see where memory was being used. Showing up consistently while launching a specific app but then fixing itself on reboot might mean that some critical system process is using too much memory and isn't freeing it up when it's supposed to, so there's less memory available for the foreground app to use before the system runs out. That app in particular requires more than most, and it ends up going over the limit. Clearly that's not supposed to happen.. Can you post the whole log?
|
# ? Jan 15, 2015 09:34 |
|
chimz posted:That's a low memory log - the OS has run out of memory and had to kill a visible app to keep the system alive. Also, iPad 3 was one of the worst if not the worst iOS device ever released, btw. I would not be surprised if the latest OS upgrade that runs on it struggles with its by now very limited resources. EDIT: Yeah it seems to be a problem with iPad 3's: https://discussions.apple.com/thread/3833420 Doctor w-rw-rw- fucked around with this message at 10:45 on Jan 15, 2015 |
# ? Jan 15, 2015 10:36 |
|
Doctor w-rw-rw- posted:Virtual memory page shortage -> couldn't allocate enough pages -> low on disk space (to page out to)? available address space? Definitely has something to do with too much memory being used or too litle being available, IMO. It runs like a loving sloth on 8
|
# ? Jan 15, 2015 12:50 |
|
pokeyman posted:Check out the Safari Web Content Guide, specifically the section where it talks about what it calls "Web Applications". It'll talk about how to set the home screen icon, the image that displays while it's loading, and how to hide the address bar and such. You'll probably need to run a lil web server on your computer and visit it on the iPhone in order for it to pick up all the icons and stuff, but that's easy to do (e.g. in Terminal, cd to the directory then run python -m SimpleHTTPServer). Set up a cache manifest (also discussed in the linked guide under "Storing Data on the Client") so it'll run without your toy web server running. You can probably snipe the other app's icon from its bundle somehow, and even its launch image if you want to keep up the ruse a few seconds longer. You can include video, do some JavaScript gesture stuff, whatever you need, it's just a webpage. Thank you and everyone so much for the help. I feared much mockery both for my non-skillz and potentially stupid idea but received anything but!
|
# ? Jan 15, 2015 17:53 |
|
Jaypeeh posted:Thank you and everyone so much for the help. I feared much mockery both for my non-skillz and potentially stupid idea but received anything but! We're not all bad people here in this thread
|
# ? Jan 15, 2015 18:17 |
|
Doh004 posted:We're not all bad people here in this thread Whatever. I'd kill a baby if it would mean no more rotation issues.
|
# ? Jan 15, 2015 18:20 |
|
lord funk posted:Whatever. I'd kill a baby if it would mean no more rotation issues. gently caress handling UISplitViewController rotations in both iOS7 and iOS8.
|
# ? Jan 15, 2015 18:38 |
|
Speaking of being nice to noobs...... I'm trying to learn programmatic constraints but I'm having an issue I'm getting the following message: code:
Shouldn't they be set when I try to set the constraints? I have a feeling it's something simple that I'm messing up as I've looked at a few examples and they don't seem that different from mine. Maybe my constraint string is bad? Here is implementation: code:
code:
code:
|
# ? Jan 15, 2015 23:22 |
|
I think you need to add the constraints onto the mapview, not the bar. Add constraints onto the mentioned view that's topmost in the view hierarchy.
|
# ? Jan 15, 2015 23:57 |
|
|
# ? May 17, 2024 15:31 |
|
Your loadView doesn't seem to call [super loadView]. Call it at the top of your loadView.
|
# ? Jan 16, 2015 02:30 |