Mobclix implementation methods conflict Xcode 4.5 - objective-c

Im implementing Mobclix in my app but got 2 method conflict warnings:
instance method 'mcScanCStyleComment:' in category from /Users/user/MyFolder/Myapp/Mobclix SDK/libMobclix.a(MobclixController.o) conflicts with same method from another category
instance method 'mcScanCPlusPlusStyleComment:' in category from /Users/user/Myfolder/Myapp/Mobclix SDK/libMobclix.a(MobclixController.o) conflicts with same method from another category
The app is running OK on simulator despite the warnings, but shows no test ads.
Any idea how to get rid of these warnings and show the ads?
Im using XCode 4.5.

Just heard back from Mobclix support. The warnings are apparently a known issue, and they recommend ignoring this issue until their next release.
As far as the ads not showing, I had the same problem until they pointed out that the size of ads weren't available for the device I was using. (Was trying to use the 320x50 ads on iPad, which they deprecated. They're using 468x60 ads now).

Related

Runtime warning CLSUserDefaults is implemented twice

I have seen a similar warning to that below for a pod-defined class when using #import syntax in cocoapod sources, but this is an internal apple class definition (CLSUserDefaults) which I have no control over and am not subclassing.
I don't know if this is really causing a problem, but it shouldn't be happening.
objc[22040]: Class CLSUserDefaults is implemented in both
/System/Library/PrivateFrameworks/ClassKit.framework/Versions/A/ClassKit (0x7fff9932d2c0) and
/Users/devusrid1/Library/Developer/Xcode/DerivedData/MyApp-cdokjmhxdrnhuodmhtibejxyqmqt/Build/Products/Debug/USR ID MyApp.app/Contents/MacOS/My App (0x10057f340).
One of the two will be used. Which one is undefined.
I'm using Xcode 11
Fabirc (or Crashlytics, depending on which versions used) defines a class named CLSUserDefaults.
It seems that ClassKit in iOS 13 also defines a CLSUserDefaults class, which leads to a name collision.
It should be fine as long as your app's code not using class CLSUserDefaults directly.
If you are you using Crashlytics, update your Fabric and Crashlytics versions in your Podfile as:
pod 'Fabric’, '~> 1.10.2’
pod 'Crashlytics’, '~> 3.14’
And then
pod install
In my case same error showed (Just in iOS 13), but used another way to solve this:
I removed Fabric and Crashlytics from project (with uses in app)
Then error message changed! (There was two errors: One for RemoteNotification and one for using statusBar in AppDelegate)
I solved first using this: https://stackoverflow.com/a/45440917/5853262
Then solved second with commenting this line in AppDelegate: UIApplication.statusBarBackgroundColor = navigationBarColor
Then I reverted code to before doing step 1 using git(Before Removing Fabric and Crashlytics)
Then I fixed errors that not shown (Doing step 3 and 4)
After Clean and Build, the app launched successfully.
Notice: In your case maybe another error causes this problem, but when Fabric and Crashlytics exist, Xcode doesn't shows them. as I did, remove them, fix errors, then rollback changes and just fix bugs that you know. This would be work.

How to include WebView in Objective C without crashing

When I include a WebView component on a form in my Objective C project in XCode7 for a Cocoa application on OSX and try to compile, it compiles and then has a runtime error of:
NSKeyedUnarchiver decodeObjectForKey:]: cannot decode object of class (WebView) for key (NS.objects); the class may be defined in source code or a library that is not linked
What's the fix?
In XCode7, if you use a WebView widget, you have to add the framework. Go to the Project Navigator and click the first icon, which is your project icon. In the middle of your screen on that IDE then, you'll see General > Linked Frameworks and Libraries. Click the + and add WebKit.framework. Now when you compile, the linkage will be there and it will work.
The drawback I think is that it says it's a 10.11 component, and so if I want to deploy my app to a 10.9 system or 10.10 system, it won't work. I'm not 100% certain of this without testing, however, but do have this hunch.
ADDENDUM:
I set my project to be 10.8 compliant and then found I can run just fine on 10.8 all the way to the latest OSX.

Some Parse methods not working in iOS SDK

I added the Parse SDK today (1.2.15) to an existing project which targets iOS7 and is built in Xcode5. I followed the instructions on https://parse.com/apps/quickstart#ios/native/existing exactly. Some things work, like creating and saving a PFObject. Certain functions however cannot be found by the compiler. For instance [PFUser enableAutomaticUser]; generates the error
AppDelegate.m:21:13: No known class method for selector 'enableAutomaticUser'
and [PFAnalytics trackAppOpenedWithLaunchOptions:launchOptions]; generates the error
AppDelegate.m:20:6: Use of undeclared identifier 'PFAnalytics'
Are the docs out of date and have these methods moved? I have tried restarting Xcode and cleaning my project. I can see the PFAnalytics.h file if I expand Parse.Framework in Xcode, and when I look at PFUser.h I can see a declaration of enableAutomaticUser;. Why can Xcode see some Parse classes and methods but not others?
My problem was that Framework Search Paths in Build Settings contained two directories, and one was invalid, resulting in this very strange behavior where some methods in Parse worked and others didn't.

Why is checking [NSMetadataQuery class] crashing on iOS 4.2.1?

I'm attempting to use this approach, described by Marco Arment, for checking if a class exists before using it. With the correct settings, classes are automatically weak-linked when it's appropriate. As Marco describes, "you can safely subclass or have pointers to whatever you want (as long as you’re careful not to instantiate them when they’re not available)".
My app runs fine on iOS 5. I've followed the conditions mentioned at the link:
Base SDK is Latest iOS (iOS 5.1)
Deployment Target is iOS 4.0
Compiler for C/C++/Objective-C is Apple LLVM compiler 3.1 (also tried LLVM GCC 4.2)
Any time I reference NSMetadataQuery I'm making sure the class exists first:
if ([NSMetadataQuery class] != nil) …
Despite all this my app crashes immediately on launch if I try to run it on an iPod touch with iOS 4.2.1:
dyld: Symbol not found: _OBJC_CLASS_$_NSMetadataQuery
I've tried commenting out all the code any my app runs fine. As soon as I add back in a single reference to NSMetadataQuery, it crashes. I've even tried this:
if ([NSMetadataQuery class] != nil) NSLog(#"OK");
Simply including that line, and no other reference to NSMetadataQuery, crashes the app. Even more strange, checking for other iOS 5 classes doesn't cause any problems:
if ([UIDictationPhrase class] != nil) NSLog(#"OK");
That works fine, as expected.
I have been able to work around the problem using the uglier NSClassFromString() to make sure the class exists, but I'd love to know why the other approach isn't working.
I don't have an explanation to this but I ran into the same problem as you. No matter what I/you do, NSMetadataQuery just won't be weak linked...
Refer to this answer, which is really the best one in another question:
https://stackoverflow.com/a/8426591/129202
In short, other auto weak linking seems to work, it's just NSMetadataQuery* that you have to remove from source and replace with id. Instantiate the class with NSClassFromString() etc. No hiccups on other classes like UIDocument however so you can safely use those in the normal sweat free way.
NSMetadataQuery is available in iOS 5.0 and above, so any versions below that has no clue as to what it is. By merely using it in your code, the class name will be added to a symbol table and looked-up when the app launches.

iOS 5 TableView crashes

Something got changed at the new SDK and my code suddenly isn't working.
I created a new empty project and created only a UITableView in it.
I used the same code as i've been used to, except the compiler said that i do not need to use autorelease anymore, so i removed it.
Oh, and I replaced retain with strong as i was recommended.
When I run the app it shows the TableView like it should look, but the minute i touch anywhere on screen, like scrolling for example, it crashes with EXC_BAD_ACCESS error.
What do I miss??
You should post some more informations on where your program crashed! But I don't think the mentioned compiler warnings are the reason. You should have tried to run your project with the compiler by turning of ARC (automatic reference count) and see what happens. If you can go back, do that first.
Also maybe there went something wrong with the changes you made because of ARC . If you have not done the changes with the Xcode refactoring tool I recommend you doing so.
Therefor select in the Xcode Menu:
Edit > Refactor > Convert to Objectiv-C ARC...
It will go through your code and apply the changes. Apple recommends though that your project should work without crashes and warnings before using it.