Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8569501
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T18:20:59+00:00 2026-06-11T18:20:59+00:00

resource create BY: (void)parseNodeAsMap:(XMPPElement*)message { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; if ([[message name]

  • 0

resource create BY:

(void)parseNodeAsMap:(XMPPElement*)message
{
 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];

if ([[message name] isEqualToString:@"presence"]) {
   // NSLog(@"presence--%@--%@",[message attributeStringValueForName:@"type"],[message from].resource);
    if ([[message attributeStringValueForName:@"type"] isEqualToString:@"unavailable"]) {
        [[NSNotificationCenter defaultCenter] postNotificationName:@"VedioChatUserStatusNoti" object:[message from].resource userInfo:[NSDictionary dictionaryWithObject:@"0" forKey:@"key"]];
    }else {
        [[NSNotificationCenter defaultCenter] postNotificationName:@"VedioChatUserStatusNoti" object:[message from].resource userInfo:nil];
    }

}else if([[message name] isEqualToString:@"message"]) {

    if ([[message elementForName:@"body"] stringValue].length<1) {

        [[NSNotificationCenter defaultCenter] postNotificationName:@"VedioChatMsgNoti" object:@"...." userInfo:nil];
    }else {
     //   NSLog(@"message--%@",[[message elementForName:@"body"] stringValue]);
        [[NSNotificationCenter defaultCenter] postNotificationName:@"VedioChatMsgNoti" object:[[message elementForName:@"body"] stringValue] userInfo:nil];
    }

}else {

}
message = nil;
[pool drain];
}

and use at this:`#pragma mark NOTI

(void)getChatUserStatus:(NSNotification*)noti{

NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSArray *user = [[noti object]componentsSeparatedByString:@"@userid"];
if (user.count<2)
{
    RoomUser _ru = {_ru.p_id = userId,_ru.nickName = [[user objectAtIndex:0] copy],_ru.role = @"0"};
    [_listDic setObject:[NSValue valueWithBytes:&_ru objCType:@encode(RoomUser)] forKey:userId];

    int insertIndex = 0;
    ...
    [_listKeys insertObject:userId atIndex:insertIndex];


    onlineUserNum++;
}else {
    RoomUser _ru = {_ru.p_id = [[user objectAtIndex:1] copy],_ru.nickName = [[user objectAtIndex:0] copy],_ru.role = [[user objectAtIndex:2] copy]};

    if (![noti userInfo]) {
        [_listDic setObject:[NSValue valueWithBytes:&_ru objCType:@encode(RoomUser)] forKey:[user objectAtIndex:1]];

        int insertIndex = 0;
        ...
        [_listKeys insertObject:_ru.p_id atIndex:insertIndex];

        onlineUserNum++;

    }else {

        [_listKeys removeObject:_ru.p_id];
        [_listDic removeObjectForKey:_ru.p_id];
        onlineUserNum--;
    }
}

//设置第一个标题的 内容
[(UIButton*)[titlesView viewWithTag:1] setTitle:[NSString stringWithFormat:@"%@ %d",[_titles objectAtIndex:0],onlineUserNum] forState:UIControlStateNormal];
user = nil;
[pool drain];     

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T18:21:01+00:00Added an answer on June 11, 2026 at 6:21 pm

    You are leaking NSString objects from componentsSeparatedByString: because you copy them: [[user objectAtIndex:0] copy].

    You have to make sure that the NSString instances are released properly when the boxed RoomUser is removed from the dictionary.

    A better approach would be not to carry around the C struct RoomUser and instead put the data in a dictionary or proper Objective-C object.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am customize telerik Datapager control in that control create one resource file and
I am able to create alternate dictation grammars using the dictation resource kit or
I would like to create one EMF object and use it in various Resource
I want to create separate folders for my layouts, like this in my resource
Okay, I have the following create action #posts_controller, nested resource under discussions def create
Using: private void play() { VideoView v = (VideoView) findViewById(R.id.videoView); MediaPlayer mp = MediaPlayer.create(this,
I'm trying to use Castle Windsor to create my message handlers because just using
I'd like to create a resource file (in the process of preparing for deployment),
I create this filter : public class LoginFilter implements Filter { @Override public void
I send POST request to create some data resource on server. I get Response

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.