Class vs Structs Both: Store values, initialize, subscripts, extensible & protocol Class can inherit, de-initialize, reference counting & typecast Functions vs Methods Methods are FUNCTIONS INSIDE A CLASS Functions can be inside or OUTSIDE A CLASS! Cannot use functionName(param1,param2) to call a function declared inside a class {} Methods: It is implicitly passed the object for which it was called It is able to operate on data that is contained within the class Instance Methods vs Type Methods (Instance Method vs Class Methods I think) Methods are functions that are associated with a particular type. Classes, structures, and enumerations can all define instance methods, which encapsulate specific tasks and functionality for… Read More
Continue Reading
Swift Optionals Quick Reference
Optionals confuse me so I wrote this post and hope it can be of some help. OPTIONALS Takeaway #1: Optionals are used to declare a variable but are not assigned a value at start Takeaway #2: Optionals contain a Some or None value, they DONT contain a String or Array or whatever else. Takeaway #3: Therefore we MUST unwrap the value of an Optional to see what the prize is 🙂 In other words, to access its value! Takeaway #4: DECLARATION OPTIONS A) Using the following syntax: var someVar? – You will mostly use this… B) Using “var someVar!” <Implicitly unwrapped> – Unfortunately UIKit & other Apple frameworks will use a lot of… Read More
Continue ReadingWhy, oh Why, did Apple take away ARC just to give us Optionals!?
I’m having trouble understanding optionals so here is a shot at explaining them. 🙂 var thisIsAnInt: Int Simple, this is an Int variable declaration. var couldBeAnInt: Int? This on the other hand is an optional variable declaration. This optional declaration doesn’t mean: “this is an int, which is optional”. It reads more like: This is an OPTIONAL variable. It’s a type of variable in and of itself. Its NOT NECESSARILY an Int. It just may or may NOT contain an Int”. Woah! Ok so what is it for and when do you use it. Well that part seems simple enough: If that variable can or could or may be nil… Read More
Continue ReadingLocal Server Auto Upload XML File to Web Server
hi i made this app called iDashBoardCenter which basically dl an xml file from a web server of your choosing. the problem is that most users have a local private server with internet connection and a local database. They want that local server to upload the created xml file to a webserver they also manage. Ive got the code that reads the local db and creates the xml file on their local directory but i have no idea how to upload the created xml file copy to a webserver which they can access. the problem remains that an asp code must be run on the local machine “magically” and then… Read More
Continue Reading