iOS 7 Content stretches over several UITableViewCells - ios

Follow-up question to my other question "iOS tableView with time at left"
I'm trying to implement a calendar like application like this using this project found at GitHub
I've tried to create a ViewController with a CollectionView and also a CollectionViewController, then import "MSCollectionViewCalendarLayout" header and implementation file and setting them as a custom layout for the CollectionView.
Trying to build from the workspace file gives me this error:
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1
Trying to build from the Xcode project file gives me this error along with the above one:
RestKit.h file not found
What is the correct way to start using this project using a simple structure for every item?
I can't seem to find any tutorial or similar with instructions on how to get started.
My question is as follows: Can someone help me explain how I can get started with this, without using the SeatGeek API?
Thanks a lot for help!

There seem to be a couple problems here: What's going on with the example first, then why it's going under your navigation stuff second.
I'll start with the first issue.
His example is using Cocoapods, and it seems like he attempted to attach the completed xcworkspace to make it easier, but it didn't work for me either.
I'd suggest installing Cocoapods and running the pod install yourself. All the instructions for how to do that should be in that link.
After doing that, the thing still wouldn't compile because some pod is attempting to set an enum to something that isn't a compile time constant. Just go ahead and change the enum values to constants (should be 1000, 750, 250, 50 respectively for the missing values) for the sake of getting the example running. If you were using pods in production code, you would NEVER want to do this, but since this is an example utilizing outdated pods, just take the path of least resistance here.
As far as the content being under the navigation bar, you're probably going to have to muck about with setting the CollectionView's contentInsets. You could also just pin the CollectionView to be under that header bit you have there with autolayout or frames.

Related

Transferring Xcode Project from one computer to another brings random errors?

I have a Xcode project I got from another developer. Initially when I opened it it has a bunch of errors (most of which were un-updated frameworks). I got it to work after a while and I fixed it. I want pass it back to the manager since I'm leaving uni in a few months. I copied it over to my friends Mac to see what would happen if I just took the project and all it's folders and made it a zipfile. It didn't work for some reason. It gave me an error:
error: using bridging headers with framework targets is unsupported
But why did that come up? I mean it's the same code on the slightly different versions of Xcode (13.1 versos 14.1) but I doubt there was a massive change between the two that would cause this. I want to be able to pass these app later in the future without having to care about this stuff. I made a GitHub (link below) would cloning that work? Also the laptop I chose was just a fresh reset. Would it be due to not having coco-pods installed?
I feel like I could go through and fix it all on that laptop and document that but then I'm afraid that every time I put it on a new one it would come up with random errors every single time making my documentation moot.
https://github.com/AbdullahMSaid/SonicExperiment-Works
With big help this was Fixed.
Things that fixed it.
Having the correct version of Xcode
Turning everything from absolute path to relative
Lots of other code fixes. But those are my project specific.
You don't need bridging headers in framework. Use should have something like "YourFramework.h" where you can import your .h files.

using Stripes bank example UI in Swift project

I am trying to use stripes UI example in my person swift project. I have tried to drag and drop the desired files inside of my project and update my headers and compile sources but I am still getting hit with errors I will leave screenshots below,
and most importantly, I am getting
I was wondering if someone has previously used Stripes BECS example UI in their own personal project and had any idea on why these issues would be popping up.
You need to install Stripe per the documentation, you can't just drag and drop files in to your project: https://stripe.com/docs/mobile/ios/basic#client-side
I'd recommend you try doing a basic example integration in a new project to figure out how the bits work, and then make use of those learnings to integrate it into your application.

content of variables is not showing xcode debugger

I have tried to debug something in my application.I run the app by setting the breakpoint, but the debugger showed me the variables without any content.
Here is an image of what I am talking about, I don't understand why the blue arrow does not appear in the left for each of the variables:
I have also opened another project and when i debugged that one, it worked. Is it related to the settings in xcode?
This is a problem related to use of Objective-C code in swift projects
Check your Bridging-Header.hand remove all unnecessary headers files from there, check if you are using cocoa-pods you need import all your pods with the import sentence, never include the header of that pod in your Bridging-Header.h
I hope this helps you, I just resolve this problem with this method
Make sure you are running a debug build, not a release build. Release builds use code optimizations that get rid of temporary variables, map variables to registers, interleave the code from multiple lines together so you can't cleanly step through line by line, etc.

Xcode 7 crash every time I try to print something in the debugger console

I've searched around and can't find anything on this.
Using Swift 2 and Xcode Version 7.0.1 (7A1001). Every time I execute something in the debugger console, Xcode crashes.
The project is not very big, and has less than 10 third party frameworks.
I can't think of much more information that's relevant, but I'm sure there's more, so please do ask me if there's anything I should add to my question that would help.
I've of course cleaned build and derived data.
It's driving me insane. Thanks!
UPDATE 16/11/12
Submitted rdar://23559366.
How are you maintaining your third party frameworks? Via Carthage?
If so then this is probably your issue: https://github.com/Carthage/Carthage/issues/924
This is an issue if the location of the /Carthage/Build/iOS folder is in a different location to where it was produced (i.e if it was compiled on a different machine and the absolute file path has changed).
A temporary fix would be to run carthage build --no-use-binaries on your machine to rebuild the symbols using the current absolute file path working around the bug.
But if you wasn't using carthage then its probably not your issue so sorry
I had similar problem with Xcode whenever I hit breakpoint.
In case you see this screen right before your Xcode crashes - you are lucky and my fix might save you. All you need to do is open this window and in the Project Navigator, select any file that you want, so that instead of that white blank view you would get your code. After this you are most likely will be able to successfully stop your app at your breakpoint and perform the debug.
I am not sure why this happens, but I suspect that the reason is Debug View Hierarchy mode, which you might have triggered prior to setting you breakpoint and trying to stop at it. At least this is when it happens to me.
I have similar problem earlier.
If you try to print non-optional variable and unfortunately it holds nil value then it breaks/crash. so that make sure declare all possible variables as "Optional type".

Using DTCoreText with RubyMotion

I'm currently working on my first major RubyMotion application. I have a lot of html text to display, and want to move away from using UIWebView -- as it's a bit of a hack and it's hard to size correctly without a lot of hoops. So, one of my options is DTCoreText, which seems like the most used and stable control of this lot.
I originally tried to use the CocoaPod version, but for some reason it's causing issues with MKNetworkKit from another pod. I messed with it for a bit, but saw that there are a lot of reported issues in MKNetworkKit about the build process, so I best left it alone.
Instead, I went for the vendor option. I git cloned the DTCoreText repo into my vendor directory and added it to my project. While it gets me closer by compiling the library and making my libDTCoreText.a file, I'm still stuck after actually running it.
My Rake files includes this (the rest is pretty generic):
app.vendor_project('vendor/DTCoreText',
:xcode,
:target => 'Static Library',
:products => ['libDTCoreText.a'])
app.libs << '/usr/lib/libxml2.2.dylib' #For DTCoreText
Like I said, the libDTCoreText.a file gets compiled and copied into the right place in my project.
My app has this in the code. It's as basic as possible -- I just wanted to see it work.
#source = DTAttributedTextView.alloc.initWithFrame(CGRectZero)
#source.attributedString = NSAttributedString.alloc.initWithHTMLData(post.source.dataUsingEncoding(NSString.defaultCStringEncoding), options:{}, documentAttributes:nil)
#source.frame = [[self.frame.size.width / 2 - size.width / 2, 600], [250, 250]]
The application compiles, fine but at runtime when we hit the code above, it crashes with:
Objective-C stub for message `initWithHTMLData:options:documentAttributes:'
type `##:##^#' not precompiled. Make sure you properly link with the framework
or library that defines this message.
*** simulator session ended with error: Error Domain=DTiPhoneSimulatorErrorDomain
Code=1 "The simulated application quit." UserInfo=0x10019d470
{NSLocalizedDescription=The simulated application quit., DTiPhoneSimulatorUnderlyingErrorCodeKey=-1}
Does anyone have any ideas where I can start looking? I don't know a ton about the XCode build process yet, so it's possible I'm missing something. But it just seems like it should work. It's saying to me that it can see the headers correctly (and can compile), but it doesn't know where the actual library is.
Well, I have relevant experience with DTCoreText but none with RubyMotion. DTCoreText uses categories, and as such has special load requirements. In my Xcode project, in "Other Linker Flags", I have this: -force_load $(BUILT_PRODUCTS_DIR)/libDTCoreText.a
That line insures that the library is properly loaded. If you don't do that, you get crashes when you try to use it.
I've been very happy using DTCoreText now for a year, and IMHO its a much better solution for attributed text than using UIWebViews.

Resources