Visualizzazione post con etichetta ios. Mostra tutti i post
Visualizzazione post con etichetta ios. Mostra tutti i post

venerdì 23 giugno 2017

Fix the issue "Unknown class xxx in Interface Builder file"

Trying to mix Objective C and Swift class I faced the followed issue: running my application and opening a specific View Controller (written in objective C) using a table cell (written in Swift) including a custom view (written in Swift) I saw the following message in the XCode 9 console:

"Unknown class MTMCheckbox in Interface Builder file"

The 3 involved class where:

MTMMatchDetailViewController (ObjC)
MTMAvailabilityCell (Swift file + XIB) 
MTMCheckbox (Swift file)

The error comes from MTMAvailabilityCell XIB.

This was the class definition for my MTMCheckbox.swift:


Thanks to this StackOverflow thread and the user1760527's answer I was able to fix adding (MTMCheckbox) after the notation @obj:

This seems a workaround renaming a Swift class: in my case, MTMCheckbox was previously an Objective C class that I rewritten in Swift.

I hope this can help someone else having the same issue.




lunedì 31 ottobre 2016

The player photos arrive also on iOS: download My Team Manager 1.5.1 for iOS

My Team Manager version 1.5.1 offers now the possibility to save a profile photo for the players of your team.

This new release adds also new tactics that can be chosen for football 11 vs 11 and 9 vs 9, it includes an improvement to enter the players rating and many other bug fixing.

You can download it from the Apple Store. Click here


domenica 24 maggio 2015

Disable log when you release an iOS version

NSLog is very useful during the development phase but it's not secure to have it enabled when you want to release your application on iTunes.
A quick solution, avoiding to change each class of your project, is the following (thanks again to Stackoverflow)
Put this 3 lines at the end of your application -prefix.pch file:
#ifndef DEBUG
  #define NSLog(...) /* suppress NSLog when in release mode */
#endif
You don't need to define anything into your project, because DEBUG is defined in your build setting by default when you create your project.

sabato 16 maggio 2015

MakeAppIcon: easily creation of your application icons

The service MakeAppIcon helps you when you need to create multiple sizes icons for your applications.

You can drag and drop your original image (preferably 1024x1024) in the toaster's home page and after few seconds you will have all the needed icons for your iOS (iWatch included) and Android application.

You can enter your email address to receive everything directly in your inbox.




mercoledì 13 maggio 2015

Find errors in your iOS project .strings files with Plutil

When you have an syntax error in your application's localization file and you try to build your project, Xcode will give you the follow error:

/Users/Emanuele/git/MyTeamManagerIPhone/MyTeamManagerIPhone/fr.lproj/Localizable.strings:0: Read failed: The data couldn’t be read because it isn’t in the correct format.

Often the error is a missed semicolon somewhere in the file but Xcode won't point it out and when the file is big, find the issue manually can be a timing consuming task.

I found on Stackoverflow a very useful response to a similar problem. The solution is using a utility of OS X called plutil, which allow to check the validity of a property file or convert a plist file to another format.

So if your run the command:

plutil -lint <yourpath>/Localizable.string

you can get a clearer message helping you to find immediately where your file has the problem:

2015-05-14 00:08:12.331 plutil[40933:3760056] CFPropertyListCreateFromXMLData(): Old-style plist parser: missing semicolon in dictionary on line 99. Parsing will be abandoned. Break on _CFPropertyListMissingSemicolon to debug.
/Users/Emanuele/git/MyTeamManagerIPhone/MyTeamManagerIPhone/fr.lproj/Localizable.strings: Unexpected character / at line 1

giovedì 13 marzo 2014

ObjectiveC: Create a thread safe singleton

If you need to create a singleton keeping it thread-safe, Apple recommends to use the dispatch_once paradigm.

Below an example taken from a Stackoverflow thread (where a user mention this method is 2 times faster than using the classic synchronized paradigm):

+ (MyClass *)sharedInstance
{
    //  Static local predicate must be initialized to 0
    static MyClass *sharedInstance = nil;
    static dispatch_once_t onceToken = 0;
    dispatch_once(&onceToken, ^{
        sharedInstance = [[MyClass alloc] init];
        // Do any other initialisation stuff here
    });
    return sharedInstance;
}

lunedì 22 ottobre 2012

Ground Control: a simple iOS library to control your remote for control

The needs to control your application from remote is becoming more and more important. Talking about iOS application you might want to hide or control some features during the Apple validation process or after the application has been launched.

Or maybe you'd like to show a specific message to the user under certain conditions that you can verify on server side.

Ground Control is an iOS library built on top of AFNetworking that makes easy to accomplish this task.

GroundControl asynchronously downloads and reads a remote plist file. This could be a static file or generated dynamically, like in the following examples

Few lines of code and you are ready to go. Discover more on GitHub