The Controls collection cannot be modified because the control contains code blocks

Hello There,

Today, I will talk about an exception, that might occur, if you have used Ajax custom controls along with their JavaScript in ASP.Net application.

Error.png

All you need to do is to add your JavaScript in a div tag and add runat=”server”

DIV.png

Hope it helps!

Cheers,

Rohant K.

Advertisements

Implementing 3D Touch Quick Launch with Objective C

Hello There!

Today, we will talk about implementing the 3D Touch for iOS Devices using  “OBJECTIVE C“.

I will take couple of minutes (please bear :)) to vent out my frustration at Apple KB for giving Objective C a step-motherly treatment for promoting their retarded Swift language for documenting new features.

The reason I have emphasized Objective C above is because of a reason; there isn’t any proper documentation available written in Objective C for using / implementing 3D Touch. I did spend time to understand and implement 3D Touch in Objective C and I don’t want others to through the same process. OK – So Let’s Get Started !!

This blog assumes the reader has a knowledge of Objective C, XCode IDE and Apple’s newest feature – 3D Touch!

There are 5 Steps to implement this!

Step 1:

Open Xcode and create a Single View Application, with the name “test3D”

Screen Shot 2015-12-19 at 1.52.42 PM.pngScreen Shot 2015-12-19 at 1.53.55 PM.png

Step 2:

You need to remember, that the Quick Launch feature of 3D Touch, is actually executed from your Home Screen. So, you need to keep the following attributes ready:

  1. Image for the Quick Launch
  2. Quick Launch Shortcut Title
  3. Quick Launch Sub-Title

Step 3: In your XCode Project, open the Assets.xcassets image catalog file, and right click on vacant area, you will be shown a context menu option. Click the “New Image Set” menu.

Screen Shot 2015-12-19 at 2.07.39 PM.png

After clicking the New Image Set menu, you will be shown an area, where-in you can drag and drop your image on the three image image placeholders, as shown below:

Screen Shot 2015-12-19 at 2.13.21 PM.png

You are required to drop three images, one onto each placeholder.

I dropped in an image for 1x at 35px X 35px and for 2x – 70px X 70px and for 3x – 105px X 105px

Remember: For each menu option, there would be a new Image Catalogue that needs to be created.

For now lets use only a single menu for our 3D Touch Quick Launch example. An appropriate / meaningful name must be given to each of the image set catalogue.

Step 3:

Now lets shift our focus on the Info.plist file we have in our project.

Here you need to create an Array of Dictionary type for each of the Quick Launch menu option.

In the Info.plist file, right click the row and click “Add Row”

Screen Shot 2015-12-19 at 3.07.37 PM.png

And then add the UIApplicationShortcutItems Key with the Type Array.

Screen Shot 2015-12-19 at 3.08.18 PM.png

Now add a new Dictionary within the newly created UIApplicationShortcutItems array. Right click on the UIApplicationShortcutItems array and click Add Row as shown below:

Screen Shot 2015-12-19 at 3.12.45 PM.png

Now add Item 0 with type Dictionary

Screen Shot 2015-12-19 at 3.13.00 PM.png

You need to add 4 attributes into this Dictionary:

  1. UIApplicationShortcutItemTitle
  2. UIApplicationShortcutItemSubtitle
  3. UIApplicationShortcutItemType
  4. UIApplicationShortcutItemIconFile

UIApplicationShortcutItemTitle: Here is where you add give title to your Quick Launch menu item

UIApplicationShortcutItemSubtitle: Here is where you add a “meaningful” subtitle to your Quick Launch Shortcut Item

UIApplicationShortcutItemType: You must give a name to your ShortCut item. This name will be identified in this application, when the QuickLaunch Item will be pressed. So again, please give a meaningful name to it

UIApplicationShortcutItemIconFile: It is here that you refer the name of your Icon Catalogue in Step 2. In our example it was just by the name “Image”.

As shown below, we add the four Quick Launch attributes to the Dictionary item:

Screen Shot 2015-12-19 at 4.19.29 PM.png

Step 4:

Now we will shift our focus to the AppDelete file in our project. Click open the AppDelegate.m file and add the completionHandler for the ShortcutItem

AppDelegate.h

Screen Shot 2015-12-19 at 4.56.37 PM.png

*NOTE: I have declared a global variable by the name

AppDelegate.m

Firstly, Add the Below code into application:didFinishLaunchingWithOptions function

Screen Shot 2017-01-11 at 10.24.52 PM.png

* I have removed few boiler plate code here from the AppDelegate.m

Add Global Variable with the name asShortCutType

Screen Shot 2015-12-19 at 4.58.37 PM.png

Screen Shot 2015-12-19 at 4.58.47 PM.png

Please note that in the shortcutItem.type check, we are specifying the name that we had added into the UIApplicationShortcutItemType attribute – <Product Bundle Identifier>.Square

By now, your application should be having a Quick Launch short cut item popping out, when you press on the application icon in the Home Screen

IMG_4341.PNG

Now when you press the Square Quick Launch menu item, the completion handler in the AppDelete.m gets fired. It is here that, if you have multiple menu item, then you can identify it by using Global Variable declared in the AppDelegate file.

In our example, the global variable is by name asShortCutType

ViewController.m

Add the reference to AppDelegate.h file. And add the code in the viewDidLoad event of the ViewController. It is here that the value of the variable in the AppDelete.h file gets passed to the ViewController, and the ViewController gets notified, which menu option was clicked.

Screen Shot 2015-12-19 at 5.11.35 PM.png

Step 5: (Last but very important!)

Now that you are enjoying that the Quick Launch is getting fired, there is one more thing to apply the 3D Touch Quick Launch completely.

There is a stage in the application, where in the application is in the background state, when you press the home button.

In that case, the viewDidLoad event will not fire at all and your ViewController will not get to know, which menu option got clicked.

There is a workaround for this too 🙂 . In your viewDidLoad event handler, add the below line of code:

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(check) name:UIApplicationDidBecomeActiveNotification object:nil];

.. and add a method by the name “check” as mentioned in the quote above.

Screen Shot 2015-12-19 at 5.11.46 PM.png

THAT’S ALL FOR YOU TO IMPLEMENT 3D TOUCH USING OBJECTIVE C

-Cheers!!

Rohant K.


		

Could not find developer disk image

Hello There!

You’ll find this message in your Xcode IDE, if you have recently updated your iOS Device (iPhone or iPad) with latest OS and trying to debug the your iOS app with your updated iOS device.

images.png

We’ll if you have done so, you need to also update your Xcode IDE version to the latest one from your App Store. There should be an update for this available for sure from Apple.

After you have updated the Xcode IDE, this message should go off.

-Cheers!!

IIS – (413) Request Entity Too Large (SSL)

Hello There!

Today, I talk about an error that you might face, while transmitting large information using your IIS .NET Web Service.

I faced this problem, while I had my web service with a valid SSL certificate. I did not find this error message when I did not connect my web service with a SSL Certificate. I had a image also to be uploaded in the same request.

The solution to this is problem is a straight-forward one, but a little tricky to find 🙂

You will have to first open the applicationHost.config file, which should reside in your <Windows Installation Drive:>\Windows\System32\inetsrv\config\

Please take a backup of the existing applicationHost.config before you make any changes to it.

Open the file, and as you see, it is a fairly large file, with different XML tags relevant to IIS Web Sites. You need to scroll down and find your IIS Web Site Name.

If the Web Site name is not found then you can add it, so don’t worry if you don’t find it.

Untitled.png

What is written here in common terms is, you are suggesting the IIS to increase the buffer size of the transmitted data to 10 MB for your web site.

And if all goes good, you are able to now transmit information to your IIS .Net Web Service!

-Cheers!

iOS – ITMS-90475 “Invalid Bundle. iPad Multitasking support requires launch story board in bundle”

Hello All, Its been a while, since I am away from my blogs. I hope I have not missed much !

Today, I will take you through a situation where you have a iPad Application or a iOS application with Universal device support (iPhone & iPad) and you want to create an archive and upload the build to the Apple iTunes Connect Build repository for app review.

Well, since few months back, Apple has changed the policy to review the applications that you have built. It now also undergoes into the processing stage, where, it will check if all the required attributes for the application is available on the Info.plist file.

I had recently tried to upload my iPad app on the Apple iTunes Connect portal for app review. And while undergoing the process of uploading an app to the iTunes Connect portal, I encountered these error messages:

Screen Shot 2015-11-22 at 2.53.20 PM.png

Screen Shot 2015-11-22 at 2.53.14 PM.png

Screen Shot 2015-11-22 at 2.53.07 PM.png

After researching for a while, I found that I am missing a attribute to add into the Info.plist file for allowing the application to know, if it supports multitasking or not. Presumedly, it is for the new iOS 9 feature for iPads which allows a split screen view for multi-tasking.

So, what do we do now?

Screen Shot 2015-12-04 at 1.00.19 PM.png

Open the Info.plist file, and add the UIRequiresFullScreen attribute to it and specify the type to BOOLEAN and specify True or False, depending upon your app’s requirement.

Then you can archive and upload to the Apple iTunes Connect portal for app approval.

Bare in mind, the app also undergoes a stage, where it simply shows the status as (Processing). And it will be there, until you upload a new build version with all the applications’ required attributes to be added into the Info.plist file.

I had few of them in the builds section in iTunes Connect with incomplete attributes, and it will lie there for now 🙂

Screen Shot 2015-11-22 at 8.26.54 PM.png

-Cheers !

Rohant Kunnat