Advertise here




Advertise here

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Badges

BrianSlick · Treadmill Desk Ninja · @ @ @ @ @ @ @ @

About

Username
BrianSlick
Joined
Visits
6,446
Last Active
Roles
Tutorial Authors, Registered Users
Points
435
Posts
10,687
Website
http://www.briterideas.com
Badges
24
  • Re: Question about collection

    In addition to my previous answer to your similar question, you can't expand a tuple. A tuple is more like a struct than a collection. If you get an array of 3 items, you can append more data and get a total of 10 items. You can't do that with a tuple. A tuple defined as having 3 items will only ever have 3 items. You cannot append more data. You would have to change the definition of the tuple to have 10 items. Similarly you can't remove data from a tuple, and make it have 2 items now. Again you'd have to change the definition of the tuple.
  • Re: Setting NSDate for UILocalNotification

    let date = eventdate as! NSString
    

    You are trying to force a date object to become a string object, which doesn't work in ObjC either.
    var DateInFormat = dateFormatter.stringFromDate(date)
    

    And now you're trying to create a string from that "date" (that you tried to force to be a string). But you never actually use DateInFormat anywhere. So not only would it be a string, which you don't want, you don't even do anything with it anyway.
    notification.fireDate = date
    

    At last, you finally try to do something with the "date", which as noted above, the first thing you tried to do was force this to become a string. And yet you're trying to give it to a date property.

    And yet you are baffled by an error message that frankly could not be any clearer.



    I'm going to put this as bluntly as I can: you do not understand programming. At all. Even the slightest bit. You have been a member of this board longer than I have, and yet today you still cannot grasp even the simplest of concepts. You cannot read code. You do not understand code.

    I know this is not your profession, because there is absolutely no way that anybody would be foolish enough to pay you for coding skills. So this is a hobby for you, and it is a hobby that you are no good at. It has been almost 7 years since you joined this board, yet you understand nothing. It is time for you to pick a new hobby. You have zero skills as a developer, and you have demonstrated nearly zero ability to learn and grow as a programmer.

    You have wasted tremendous amounts of your own time by failing to adequately learn the required skills. You have further wasted the time of other members of this board. And trust me, everyone here knows that answering your questions is a waste of time, and that's largely why you aren't really getting answers here anymore.

    You will not be wasting any more of my time. Until you can make a convincing case that you have read even a single book on iOS programming, I will not be posting so much as a lmgtfy link in any of your threads. I hope that other members such as @dev666999 will do the same. You will not be able to find answers here.

    Leave this place forever, and find a new hobby.
  • Re: Keep UI elements looking same but relative in all screen sizes

    Well, I would say that in general, this isn't a problem that auto layout is intended to solve. You are putting what really isn't actually a stretchable image into a stretchable situation, relying on UIImageView's algorithm to make it fit, and then you're trying to duplicate that algorithm separately with fixed dimensions.

    I'm not saying you can't get there, but it's going to be a fair amount of work. Basically everything you need to key off of is a moving target, because of the ways you're allowing the image to be stretched. Going a row at a time, I'd say pick one button, perhaps on the left, to be the "master". All of its friends on the same row should be matching height, width, and vertical Y center (or top or bottom, whichever you care about). That master's width needs to be a percentage of the overall width, which you should be able to accomplish graphically by changing the multiplier. The kicker will be the left margin, since it technically changes ever so slightly, too. The one thing that auto layout doesn't do very well is allow you to set up relationships to "space". So in those cases, what you'll probably need to do is add another view, with a clear background. This view will serve as your left margin, again with a percentage relationship to the overall width, and butted up against the master button. Then you more or less have to do the same thing vertically.

    Edit: I've read several SO posts showing how to constrain a subview to the width of the superview and then use a percentage, but nothing is working for me. Several of those same SO posts have people expressing a similar problem, with no apparent solution. So perhaps you can't do it purely graphically. But the graphical format language option probably isn't too bad in this case.
    Post edited by BrianSlick on
  • Re: Passing Data to Root? From ViewController 5 to Root

    There are a least a couple basic options.

    1) Delegation, as you said. Don't think of it as A -> B -> C -> D as much as you are going to do A -> B multiple times. You will pass a reference to A (self) to B. Then from B, you will do basically the same thing and pass that same reference to C. And then from C you will pass that same reference to D. Now D can talk to A. At each stage, you are simply looking at the data that each view controller has available, and at each stage, the reference to the root is available because you passed it along each time. This can get a little convoluted, so I wouldn't really recommend it.

    2) Store the data somewhere else. NSUserDefaults, Core Data, a plist, a singleton object, etc. D will put its data there. A will read whatever data is there.

    And just to clarify, you do NOT need, or want, to update a label from outside the view controller. You need to update the data that feeds the label. The label can be refreshed in, for example, viewWillAppear. Never mess with the UI of a different view controller.

    But yes, you are creating a new view controller in this code. This will not be the same view controller as the one at the root of your navigation controller tree.
  • Re: UITableView -> didSelectRowAtIndexPath Not Showing Array - FIXED

    didDeselectRowAtIndexPath