iOS 8 Swift Programming Cookbook Videos, 50% off, only for 1 week

Hello interwebs,

I was informed today by O’Reilly that my title “iOS 8 Swift Programming Cookbook” videos is 50% off for a week

Here is a direct link to the video including the discount code

If you have no luck with the above link, just go to O’Reilly’s website and purchase the book with the discount code of VDWK

Ciao

iOS 8 Swift Programming Cookbook

Hi lovely readers 🙂

My iOS 8 book is out and it is ALLLLL new, rewritten to use Swift with tons of new stuff in it.

Check it out, it is 50% off. Click here to go to O’Reilly’s website to purchase the book.

Also a surprise, I have also done a video course to teach you all about iOS 8 programming with Swift. THAT too is 50% off for a limited time. You can click here to get the videos.

Happy coding everyone

Learn iOS programming

Giving private and group iOS development lessons

Hello internet. After writing many many books and developing iOS apps for 6+ years, I feel I am now ready to take on a new challenge. To start teaching iOS development to people who are interested in transforming or perfecting their career.

I am available for teaching iOS development to you ANYWHERE in the world you are in. If you are in London or in Brighton in the UK, we can have face to face lessons. If anywhere else in the world, I can teach you over Skype.

Classes will be tailor made to suite your free times, abilities, etc. If you are interested, get in touch by sending me an email at: vandad.np@gmail.com

 

iOS 7 Programming Cookbook’s Source Code

As you know, my recent book is now published, titled “iOS 7 Programming Cookbook”. You can purchase it here:

http://shop.oreilly.com/product/0636920031031.do

All the source codes written for this book are now available on Github at the following location:

https://github.com/vandadnp/ios-7-programming-cookbook-source-codes

If you have any questions, please let me know.

Compiling C files for Mach-O ARM architecture, in OS X Lion

Yesterday I wanted to compile a .c code for ARM architecture using the iOS SDK on my Lion machine. I wanted to create object files and executable files that I can install on my jailbroken iPhone 4. I have explained the process here for you. I hope it will be of help.

We are going to be using the LLVM-GCC compiler. In OS X Lion, this compiler sits here:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-gcc-4.2

Also we need to pass the path to our iOS SDK, to the compiler so that it knows where to get the libraries and frameworks from. In OS X Lion with iOS SDK 5.1 installed, the path of the iOS SDK would be here:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk

So if your SDK version is different, you need to modify that path. Now let’s write a simple Hello World C code in a file named hello.c

#include <stdio.h>

int main(void){
printf(“Hello, World!\n”);
}

Now let’s go to Terminal and change your current working directory to the directory that contains the above hello.c file. Now let’s tell Terminal where our compiler and SDK folders are:

COMPILER=”/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-gcc-4.2″
SDKDIR=”/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk”

Now we are going to attempt to compile the hello.c source file for armv7 CPU architecture:

$COMPILER hello.c -o hello.o -c -arch armv7 -isysroot $SDKDIR

Now if you get an ls -la on your folder, you will also see an object file called hello.o. If you do the following:

file hello.o

You should see an output like this:

hello.o: Mach-O object arm

So now we have the object file. If you want to link this object file into an executable file, then you can do this:

LINKER=$COMPILER
$LINKER hello.o -o hello -arch armv7 -isysroot $SDKDIR

Note: the linker and compiler are both llvm-gcc-4.2 but we pass the -c to it to compile and if we skip -c, we will link, producing the final executable file.

Now you have 3 files

  • hello.c
  • hello.o
  • hello
The first one is your source file, the second one is the compiled file and the third one is the linked (executable) file. So now do this:
file hello
You should be able to see the following output:
hello: Mach-O executable arm

That’s it. If you have any questions, let me know in the comment section below.

scp and cronjob (without password) on OS X

I wanted to copy some files from my computer over to a server every minute, as a cronjob. I searched around the internet but the solutions were scattered all over the place and a lot of “do this and do that” so I decided to put things together in this comprehensive video.

In this video, you will learn:

  1. How to set up your RSA private/public keys.
  2. How to set up passwordless SSH access to your server.
  3. How to “scp” files from your client to your server under your user name.
  4. How to set up a cronjob to copy your files over to the server once every minute.
If you have any questions, leave them down here and I will do my best helping