|
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 |
|
|
# ¿ May 17, 2024 18:10 |
|
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 |
|
I have an app which dynamically creates a bunch of UIViews, all of which override drawRect:. After upgrading to XCode 7.1 my memory usage has gone through the roof and am getting out of memory errors. I understand that overriding drawRect: will create a backing bitmap but did anything change with 7 or 7.1 to make doing this have a bigger memory footprint? I really need to have custom drawing for my views - is there a more memory efficient way to go about it compared to drawRect:? Maybe using CALayers or something? EDIT: A little bit of data. In one example I'm creating 117 444x555 size images on an iPad Mini. By my simple math ( 444 x 555 x 4 bytes for ARGB ) each backing bitmap should be about 1MB so I should see about 117MB of memory usage. I'm seeing 480MB which would make sense if the backing bitmap was being created at retina resolution - maybe previously they were being created at the view resolution which was not the case before?? fankey fucked around with this message at 00:18 on Oct 27, 2015 |
# ¿ Oct 27, 2015 00:02 |
|
I'm trying to do the followingcode:
|
# ¿ May 23, 2016 19:02 |
|
pokeyman posted:Don't use weak? In this case the parent has a reference to to the helper so I have a retain cycle I was trying to fix. The odd thing is I have one class using the Helper class without any issues and another one is throwing a NSInternalInconsistencyException on dealloc. The usage is the same so I'm not sure what's going on there. fankey fucked around with this message at 21:02 on May 23, 2016 |
# ¿ May 23, 2016 20:29 |
|
rjmccall posted:Weak reference don't magically call associated property setters when they get cleared; that's just not how the technology works. Yeah I've figured that out. My code that was there to remove the observer was never getting called. The odd thing is that in one case the objects were able to be dealloced without any issue and in another case an exception is thrown. The usage is identical so the behavior is a mystery at this point. One odd thing I'm noticing - if I step through dealloc on my Helper class the debugger has a valid value for _parent but printing _parent or any code that checks for parent against nil determines that it's nil. I'm wondering if I should forgo KVO and just roll my own since I'm in control of all the classes that are in use.
|
# ¿ May 23, 2016 21:24 |
|
I'm having issues with custom frameworks. I'm attempting to bring in SVGKit and following the instructions here - https://github.com/SVGKit/SVGKit. I can get it to work for a particular build type ( either iOS device or emulator ) but to do so I first have to rebuild the framework for the particular target, remove the existing framework and then re-drag in the new one. If I don't do this I get the followingcode:
Edit: It looks like SVGKit includes a script to make a fat binary ( from here - http://stackoverflow.com/questions/3520977/build-fat-static-library-device-simulator-using-xcode-and-sdk-4 ) but for whatever reason it still fails when I attempt to build my project. hmmm... fankey fucked around with this message at 17:24 on Jun 17, 2016 |
# ¿ Jun 17, 2016 16:21 |
|
Doc Block posted:Yeah, you need a fat binary if you want just one .framework Looks like the framework I built only includes ARM code:
fankey fucked around with this message at 20:18 on Jun 17, 2016 |
# ¿ Jun 17, 2016 20:14 |
|
eschaton posted:If you're using pre-built frameworks for different platforms, I'd recommend having them in sub folders of whatever the SDK folder is that are named for the platform identifier. E.g. FooSDK/iphoneos/Foo.framework and FooSDK/iphonesimulator/Foo.framework and so on. Since Xcode will search for the framework by name at link time, you can just then have /path/to/FooSDK/$(PLATFORM_NAME) be the value that's in your Framework Search Paths build setting. Thanks for the info. I got the build working using the $(PLATFORM_NAME) scheme. Since the library is dynamic I'm having issues with running. It seems like the 'Embedded Binaries' is ignoring the $(PLATFORM_NAME) since it's complaining that no matching architecture is found. When I add the Framework to the Embedded Binaries list it shows the path to a specific Framework ( in this case the one that works ) in italics and I can't see a way to use PLATFORM_NAME as an indirection. I'd try adding everything to the same workspace but my project has somehow been broken in a way that makes it not possible to add it to a workspace - it just shows up as a single item without all the supporting stuff. This is probably due to me attempting to de-workspace when I was also de-cocoapodding since that was causing more problems than it was solving. One other question - I used Carthage to build a different library ( CocoaAsyncSocket ) and it's working without any issues and shows all architectures in one Framework file code:
fankey fucked around with this message at 23:02 on Jun 17, 2016 |
# ¿ Jun 17, 2016 22:52 |
|
Doc Block posted:Check the PM I sent you.
|
# ¿ Jun 17, 2016 23:32 |
|
After adding a 3rd party framework to my App every time I archive the result shows up in the Other Items list in the archive manager, not in iOS Apps. Searching around I see lots of different solutions to this problem - of course none of them are fixing the issue for me. Is there any way to get any debug or log information to determine why this is happening or am I doomed to search Stack Overflow and randomly try things until I get it working?
|
# ¿ Jun 23, 2016 16:23 |
|
Doc Block posted:Is the framework actually built for iOS? Is it just a closed source binary, or do you have the source code? Yes. It's the SVGKit framework which I had added as a subproject to mine. Builds and runs fine both in the emulator and on a device. For now I've just pulled their source directly into my project which is building and archiving without issues.
|
# ¿ Jun 23, 2016 18:42 |
|
Doc Block posted:Assuming you're adding it the way I mentioned earlier, I don't think SVGKit is the problem. I just built and archived a test app that contains SVGKit and it got added to the iOS Apps section of the Organizer window. SVGKit is the only 3rd party framework I'm including and moving the source directly into my project fixed the issue so there was some interaction with the framework that was causing issues. It could be a setting in my own project causing the issue but without any information from Xcode as to what the actual problem is I'm not sure what's going on.
|
# ¿ Jun 23, 2016 22:20 |
|
Ender.uNF posted:Were you archiving the correct scheme? Did the archive's bundle identifier still match your app or did it change? As far as I know I was archiving the correct scheme - I only have one defined in my project. The version and Identifier are blank in the Archive manager and the Type is 'Generic XCode Archive'.
|
# ¿ Jun 24, 2016 16:30 |
|
Doc Block posted:Was your project linking to the right SVGKit platform (iOS)? If the archiver finds something it doesn't like inside the final built product then (if it builds the archive at all) it will call it a "Generic Xcode Archive". Yes, libSVGKit-iOS.2.0.0.a is listed in Linked Frameworks and Libraries. I removed SVGKits references to CocoaLogger and still had the issue. As this point I think I'm going to leave the source directly in my project and move on.
|
# ¿ Jun 27, 2016 20:34 |
|
Doc Block posted:You could always open the archive and see what's in there. Like apps, the bundle is just a folder. Right click->Show Package Contents Would having the SVGKit headers included in the archive cause the issue? They are in /Products/usr/local/include. If so, how do I stop them from being included? I tried setting Skip Install to be Yes on SVGKit but that didn't remove them from the archive.
|
# ¿ Jun 29, 2016 18:06 |
|
Any suggestions on how to track down why after updating to XCode 8.2.1, the IDE completely locks up with 99% CPU usage 10 seconds every time loading my project? This is a standard ObjC project without any Swift, CocoaPods, etc. I don't see anything interesting the the Console logs. Edit: It finally came back after 45 minutes. I think one of the issues is that I'm checking out a sparse git checkout and XCode thinks there are 10,000s of missing files which it feels necessary to report to me, even though none of these file are referenced in the Workspace. Is it possible to work with sparse checkouts in XCode or am I going to be frustrated? fankey fucked around with this message at 23:35 on Mar 17, 2017 |
# ¿ Mar 17, 2017 22:19 |
|
I just updated to XCode 9.2 and I'm running into a lot of issues with the simulator that I'm pretty sure didn't occur in previous versions. I haven't narrowed things down to simple test cases yet but one thing I've noticed is that if I change the UI via a touch interaction ( automatically scrolling a scroll viewer, setting UIView.hidden, etc ) things seem to lag one update when running in the simulator but function just fine on real devices. I'm totally open to the problem being in my code but I'm curious if anyone else has seen weird performance using the new simulators. I'm also seeing a bunch of app crashes in the simulator that I can't reproduce on real devices.
|
# ¿ Jan 23, 2018 23:57 |
|
Do you mean deleting and readding via the 'Add Additional Simulators..' item at the end of the simulators list? I tried removing and adding one and it didn't fix the issue. Do I need to remove them all?
|
# ¿ Jan 24, 2018 01:07 |
|
Simulated posted:Do you have an Intel HD 3000 GPU or something similar? As a matter of fact yes - MacBook Air Mid 2011.
|
# ¿ Jan 31, 2018 22:43 |
|
I'm attempting to use NSScanner to parse CSS style colors - rgb(), rgba(), red, blue, #RRGGBB, etc. I sorta have something working to deal with rgb/rgbacode:
code:
|
# ¿ Apr 19, 2019 18:02 |
|
Doctor w-rw-rw- posted:indexOf rgba/indexOf rob followed by replace white lspace with nothing and split from index after ( on comma, assert the last char is ). Thanks. That's pretty much where I ended up - using NSScanner for the function parsing since it's pretty easy to get the arguments but then fall back and split the string apart manually if it's hex.
|
# ¿ Apr 19, 2019 23:18 |
|
Thanks for the parser comments. I ended up finding a parser on github that met my needs so crisis averted. Now another question - is there a straightforward way to draw rounded rectangles in CoreGraphics that have different horizontal and vertical radii? Basically implementing this. WPF has a handy ArcSegment which allows you to specify both a x and y radius for the arc. All the arc functions I see in CoreGraphics only take a single radius and I'm hoping I'm not doomed to try and piece-wise approximate using bezier curves - although if someone knows a handy reference there please let me know!
|
# ¿ Apr 26, 2019 23:23 |
|
Doctor w-rw-rw- posted:https://stackoverflow.com/questions/11365775/how-to-draw-an-elliptical-arc-with-coregraphics ?
|
# ¿ Apr 30, 2019 15:51 |
|
I have an app that works fine in the emulator, fine on my device connected to XCode but fails when running the exact same codebase via TestFlight. Is there a way to reproduce what is being run via TestFlight without going throught the whole cycle of uploading the app, etc? The app draws a bunch of stuff via CoreGraphics and in this case fail means doesn't draw all the elements.
|
# ¿ Sep 5, 2019 17:32 |
|
Glimm posted:Switching the build configuration in your scheme to your production config might help. That worked - I can now reproduce bad behavior in the simulator. Now the problem is I have no idea what's going on. It's probably something obvious but here's my code. code:
code:
|
# ¿ Sep 5, 2019 22:15 |
|
Digging into this more, this codecode:
code:
|
# ¿ Sep 6, 2019 17:08 |
|
Doc Block posted:It’d probably be a good idea to clamp some of those values to sane ranges before doing any math on them, like maybe not allowing sizes smaller than 1 or something.
|
# ¿ Sep 7, 2019 00:25 |
|
I have a subproject which builds dylib that my main project is linking to and I can't figure out how to get the code signing to work so I can build and archive. I am able to emulate without any issue. The error I'm getting is this code:
Originally the antlr4 target had a 'Choose Identity' button ( or something similar ). I clicked on that and chose the antlr4_ios.plist and that filled out that section. I've made sure the Team matches my main app and set the every bundle identifier I can find to match with the understanding if I did that I wouldn't need to sign the dylib but I still can't get past that build error. Edit: Noticed that in the main project that libantlr4-runtime.dylib was set to 'Embed & Sign'. Changing that to 'Embed Without Signing' has no affect and it still looks like it's attempting to sign the dylib for some reason. fankey fucked around with this message at 19:21 on Dec 3, 2020 |
# ¿ Dec 3, 2020 17:48 |
|
Doc Block posted:For iOS you always need to sign. Are you talking about the black boxes in the screenshots? That was just me editing the screenshot to subvert the NSA - they are actually set to the same Team and Bundle as my main app. Is there a straight forward way to convert the dylib project to a Framework?
|
# ¿ Dec 3, 2020 20:34 |
|
Doc Block posted:Ohhh... that's what I get for phoneposting Thanks for pointing me in that direction - I was able to create a Framework as a child of my project and with a little finagling got everything uploaded to appstoreconnect and get it from TestFlight. I do have a couple of questions since I don't really understand Frameworks. The ANTLR4 source is huge and when it's part of the main project the whole thing builds on every Archive which on my Air takes over 5 minutes. It seems like the best thing would be to remove it from my main workspace, build it separately and then reference the Framework so I only need to rebuild if the Framework source changes. I can open up the Framework project in another copy of Xcode and drag it in but then I either get a 'Framework not found error' when Archiving for the App Store or 'Building for iOS Simulator, but the linked framework was build for iOS'. So either the way I'm building the framework is wrong or the way I'm including it is. The other thing that's odd - when I had the framework as part of the main project I had to select 'Embed & Sign' on that framework to get it up into appstoreconnect. What's odd is that I have other frameworks build locally ( using Carthage, another piece of magic I don't understand... ) and those are set to 'Not Embed' and work fine. What's different between the way Carthage is bringing in frameworks vs what I was doing? Tried following this https://medium.com/allatoneplace/writing-custom-universal-framework-in-xcode-9-and-ios-11-7a63a2ce024a and had no luck. The script didn't generate a shortcut in the project folder and the resultant build archive didn't contain any of the framework. fankey fucked around with this message at 22:27 on Dec 3, 2020 |
# ¿ Dec 3, 2020 22:12 |
|
In objc, is there an easy way to chain multiple NSURLSession.dataTaskWithURL calls? I need to do something like this procedural pseudo codecode:
|
# ¿ Mar 3, 2021 20:52 |
|
Thanks for the input. I'd prefer that they run in order so I don't have to worry about 429 errors or something similar. I don't really need to load things as fast and as parallel as possible. There might be a different approach - let me explain better what I'm trying to accomplish. I'm loading a bunch of images from an HTTP server. The current version of the app creates a separate dispatch_queue_t, uses CGImageSourceCreateWithURL to create the images and once finished makes a callback back to the dispatch_get_main_queue to notify the UI that the images have been loaded. This worked perfectly fine until we wanted to use HTTPS instead of HTTP to load the images. Because this server is an internal network appliance the certs will either be self signed or likely not installed on the iOS device. Since the certs can't be verified CGImageSourceCreateWithURL fails due to TLS issues. I do know that I can automatically trust the cert when using the URLSession:didReceiveChallenge callback. Is there a way to accomplish the same without using the async URLSession methods?
|
# ¿ Mar 3, 2021 23:19 |
|
That looks pretty fancy. Unfortunately I haven't bothered to learn Swift yet so to me it's mumbo jumbo Here's something that I came up with. Seems to work and is lacking in a bunch of error handling. It's a class you can hand a bunch of URLs, tell to go and get told when it's done. It looks like it may be kind of similar to what you were suggesting. code:
|
# ¿ Mar 4, 2021 01:03 |
|
Anyone have any experience with the the apparently new limitations on using mulitcast in apps? Our app both sends and receives multicast UDP in order to discover devices on the local network. It appears as though 14.6 broke this. I've found this page https://developer.apple.com/news/?id=0oi77447. That page has a link titled Request the com.apple.developer.networking.multicast entitlement which sends you to an odd page where you have to manually fill things out like App ID, App Name, Description, etc. I would have assumed Apple could have figured out most of this information since the app is registered but whatever. We've filled out the form and added the 'Privacy - Local Network Usage Description' string to the plist but then what happens? We haven't received any confirmation or additional information after submitting the form. At some point does someone wave their magic wand and our app starts working? Will we need to resubmit after they've done whatever they need to do?
|
# ¿ Jun 4, 2021 15:15 |
|
Simulated posted:If at all possible I highly recommend using Bonjour. It's open source (see mDNSResponder) and built-in basically everywhere at this point. We did get a response from Apple regarding our usage of multicast so hopefully we'll get a resolution soon.
|
# ¿ Jun 9, 2021 16:25 |
|
Simulated posted:Great, let me know if you have trouble getting a response and I'll see if I can find the right person to poke. Thanks for the offer. Hopefully they will respond in the next week or so. Yeah, a lot of our customers are on Cisco style 3 tier networks with lots of routing. The particular job that blew up for us was a cruise ship where every room was on it's own subnet. Not sure exactly what they were trying to solve. At the time I don't think the Bonjour routing in the switches was a thing. When a device detects a change to it it's network connectivity due to link change or AP switch it will definitely reset the interval and there aren't any issues. The problem we were seeing was due to network changes that the devices cannot detect. For example - device 1 hooked up to switch 1, device 2 hooked up to switch 2. Let that sit for an hour or so. Now connect switch 1 to switch 2. Each device will have slowed down their interval ( I think the slowest they end up at is 1 hour ) but there is nothing to inform the devices that they need to clear their cache and reset the interval.
|
# ¿ Jun 10, 2021 15:55 |
|
My app supports user supplied fonts which I draw with CATextLayer. Most fonts work just fine but some are 'bullshit fonts' like this one - https://www.dafont.com/cubic.font. In that font the author decided to have font content go below the descender ( noted below with the yellow line ). I'm not sure that's legal for a font. I do have rendering implementations based in both Qt and WPF that render the font fine but I'm struggling with trying to get iOS to not clip the bottoms off. I'm able to read the UIFont.ascender and UIFont.descender to adjust my bounds and offsets so I don't clip things within those but I can't figure how to to determine, for a particular font, how much it extends beyond the descender. Is this possible with UIFont?
|
# ¿ Oct 8, 2021 17:15 |
|
I made the always poor choice of upgrading Xcode to 13.2.1 and now I'm running into code signing issues. I have another project that I've dragged in as a Framework and had the signing set up like this free img host When I attempt to archive the app I get the following error code:
|
# ¿ Jan 8, 2022 00:46 |
|
|
# ¿ May 17, 2024 18:10 |
|
Any idea what Project setting would break using c++ 14 features in .mm files? I have a project that has a .mm file which then includes a .h file with the followingcode:
code:
Working Project : Broken Project :
|
# ¿ Apr 29, 2022 17:25 |