Tuesday, 15 April 2014

objective c - Adding An AlertView At viewWillAppear, iPhone -


I see as soon as a view appears (without using a single button) I try to show an alert view I am doing Viewcontroller.m I have:

  - (zero) viewWillAppear: (bool) animated {UIAlertView * warning = [[UIAlertView alloc] initWithTitle: @ "User Info" Message: @ "hello "Representative: Self cancelTutNitile: any other button titles: @" continue ", zero]; [Alerts show]; [Warning issued]; }  

and I have in viewcontroller.h:

  IBOutlet UIView * warning;  

I have not done anything to my .xib file

When running simulators I get the following in the console:.

2009-11-11 23: 41: 36.079 BatteryApp [867: 20b] *** Expected exception 'NSInternalInconsistencyException', due to reason the app ended: '- [UIViewController _loadViewFromNibNamed: bundle:] "BatteryAppViewController" was full of nibbles but had a visual outlet

Any idea where I went wrong to take something from my xib, wrong?

Edit // I have not set any new sequence alert to connect in my xib, even then fails. Text after "

The problem is that two major animations (for viewing current view, and a warning for Is going to be overlap

  1. The warning code is in viewDidAppear viewWillAppear

  2. Call [Alert Display Selector: @selector (Show off) withObject: after zero: 1) . This ensures that the warning is generated after the current animation is over.

You may still have to be careful about issuing a warning if I were you, then I would like a different method (for example And then call it to see DAADPER:

  - (zero) viewDeadapp: Object with BOOL animated {[Self Display Secretary: @Selector (SHAHELO): after zero : 0.0 F]; [Super viewedapper: animated]; }  

python - Set and use flags against a users profile model in Django -


I have a simple webpage in Django for an iPhone app. I want the user to review our product, but just one time. I do not want to show that sign again again.

To do this, the best practice to implement this will be to add a new entry in the user profile model with the bidding field: "Reviewed" - and then the user completes the action Set that flag?

Then I will check to appear in that template or not, prompt.

I have not worked yet database model, user model extended or saved in custom DB field, so any thoughts or examples will be welcomed on this. I'm a bit upset because my site is a live user and I do not want to break user tables.

If you are using MySQL or PostgreSQL, then you see some optional table without losing any data.

In Django, it is quite easy to add a profile for the user. Make sure the profile does not exist:

  Try: Profile = request.user.get_profile () Excluding UserProfile.DoesNotExist: # if DoesNotExists, create an empty profile = UserProfile (user = Request.user) profile.save ()  

More info here:


c# - Quick and dirty reflection based XML Serializer -


Is anyone aware of the quick and dirty implementation of a reflection-based XML serializer?

I want to extract my XML serialization code due to the fierce initial time. I know about sgen.exe but my build and packaging process does not want to complicate.

We use XML serialization at startup to remove configuration values ​​from a file, there will be less reduction in reflection, we call 20-40 values ​​as max. We do not need super fast here, I just think 500-700 mms in my case do not want to hit the hit to compile the XML serializer.

I also have to control the code, because I would like very strong error handling

I know that ProtoBuff.Net, but it can be a little overkill. Looking at the data contracts, they can be limited to a child and a lot of decoration is required, which I would like to save.

If this is only 20 to 40 values, why not remove all serialization malacres and hand codes ? You should be able to code a readings class in a flat without being able to code it, you can prepare the code and go home early, in this way it can be as strong and error as you wish. , And it will load faster than 700ms.


c# - Pulling Images from RSS Feed -


I am developing a background wallpaper converter for Windows I am thinking of drawing pictures from RSS feeds. As a way to display feed changes in the feed, I am currently dragging the page as text and searching for text like "

Well, I would have thought you would need to do this to get a partial image URL, and then Attach the baes URL to the original server (unless the URL in the RSS feed is the full URL of the image).

Then, you can download it somehow: but instead of using Response.OutputStream, use the stream to save the file to the server.

And it will write image files on your machine ...

H.H.


.net - How to serialize a derived class as its base class -


I have a derived class that only connects to the base class methods that can serialize the derived class so that it can be classified as base class Matches the serialization. That is, the ordering XML of a derived class should look like this:

  & lt; Base Class & gt; ... & lt; / Base Class & gt; For example, an invalid operation exception will be thrown in the following. "Type DerivedClass was not expected. To specify the type of XmlInclude or Use the SoapInclude attribute, which are definitely not known. " Class BaseClass {} Category DerivedClass: BaseClass {} DerivedClass derived = new DerivedClass (); Streamer stream = new streamer ("output file path"); XmlSerializer serializer = New XmlSerializer (GetType (BaseClass)); Serial (stream, derivative);  

You have to pass GetType (DerivedClass) to the Serializer constructor, it is necessary by you Match the sorted object type You can change the code in the & lt; XmlRoot & gt; You can use the attribute. This example code works as a purpose:

  using the system; Using System.Xml.Serialization; Using System.IO; Class program {static zero main (string [] args) {var obj = new DerivedClass (); Obj.Prop = 42; Var xs = New XmlSerializer (type (DerivedClass)); Var sw = new stringwriter (); Xs.Serialize (SW, obj); Console.WriteLine (sw.ToString ()); Var sr = new stringreader (sw.ToString ()); Var obj2 = (Base Class) xs.Deserialize (sr); Console.ReadLine (); }} Public Class Base Class {Public Ent Prote {get; Set; }} [XmlRoot ("BaseClass")] Public Category DerivedClass: BaseClass {}  

linux - Bash: How do I truncate an array? -


I want to change the value of an array and appreciate any help.

I found that this is an array:

  user = (root isometric okay)  

(this is actually the current user's List) that I want to be able to check that the user is present and if they do not, then to remove the person from the array I tried to evaluate it by putting it in the loop for use:

  $ i user [@]}; "User = (echo (" $ [$ [[[-z $ (grep \ "^ \ $ i \" / etc / shadow)] and \ "s \" / \ $ i // g \ "))" $ Users  

I thought about playing it with something else but I thought I was getting very complicated (I'm not sure I can place an order in an array ) Anyone have an idea on how to do this?

Edit:

How do I enter the variable variable number:

  cnt = 0 for $ i {the user [@]}; Do [-s "$ (grep" ^ $ i "/ etc / shadow)"] & amp; Amp; Users Unset [CNT] ||             

Actually Dennis is also better.

You do not need for the loop. Try it:

  users = (root isometric açau) list = "$ {users [@] /% / |}" # Convert the array to the list, after every user pipe care Add # Find the username between the empty space and the offer from the strip list # Line at the end of the word and the result, create an array out of the results users = ($ (grep -Eo "^ ($ {list //}) \ & gt; / Etc / shadow))  

grep , unraveled, will look like this:

  grep -Eo "^ (root | Isometric | akau |) & gt; "/ etc / shadow  

objective c - iPhone language setting -


I'm junior in iPhone game development. I am using cocosdaddy for this game which I am currently producing. I have completed this game, though my client wants 1 more version of this game, all the functionality except the language are the same, he wants that the game will be changed to the French version if the language of the iPhone is set to French I just need to change the button, the text inside the game with the French. But I'm not quite sure about the language setting in the iPhone, how can I change the whole thing according to language settings in different versions, nobody knows where I can start? Please give me a hand, I really appreciate any help.

Thank you very much


Here's my code. Should you do this how to localize these codes

  [MenuItemFont setFontSize: 16]; [Menu item font set fontname: @ "hellevica"]; MenuItem * backToMenu = [MenuItemImage itemFromNormalImage: @ "back_to_mainmenu.png" selected image: @ "back_to_mainmenu_PUSH.png" Goal: Self Selector: @Sillector (BackToMmenensen :)]; MenuItem * playAgain = [MenuItemImage itemFromNormalImage: @ "Eplay_again.png" Selected Image: @ "Eplay_again_PUSH.png" Goal: Self Selector: @Selector (playAgainGame :)]; MenuItem * uploadOnFaceBook = [MenuItemImage itemFromNormalImage: @ "Eupload_on_facebook.png" Selected Image: @ "Eupload_on_facebook_PUSH.png" Goal: Self Selector: @Selector (UploadOffsBookFunction :)]; Menu * menu = [menu menus along with: backmen menu, playgain, uploadonebook, zero]; Menu.position = CGPointZero; BackToMenu.position = CCP (400,40); PlayAgain.position = CCP (24040); UploadOnFaceBook.position = CCP (8040); [Add Yourself: Menu Z: 1];  

You will need to make your app localized with the localizable.string file where you have all your strings Enter the properties for each language and see: